From 4269017ffad3e8b9c8a6f6e5e1155c4d486ab465 Mon Sep 17 00:00:00 2001 From: Carlos O'Ryan Date: Fri, 28 Oct 2022 13:21:02 +0000 Subject: [PATCH] Generate samples --- .../samples/access_approval_client_samples.cc | 59 ++++++++++++++++++ .../access_context_manager_client_samples.cc | 60 ++++++++++++++++++ .../samples/api_gateway_client_samples.cc | 59 ++++++++++++++++++ .../samples/connection_client_samples.cc | 59 ++++++++++++++++++ .../samples/api_keys_client_samples.cc | 59 ++++++++++++++++++ .../samples/applications_client_samples.cc | 59 ++++++++++++++++++ .../authorized_certificates_client_samples.cc | 59 ++++++++++++++++++ .../authorized_domains_client_samples.cc | 59 ++++++++++++++++++ .../samples/domain_mappings_client_samples.cc | 59 ++++++++++++++++++ .../samples/firewall_client_samples.cc | 59 ++++++++++++++++++ .../samples/instances_client_samples.cc | 59 ++++++++++++++++++ .../samples/services_client_samples.cc | 59 ++++++++++++++++++ .../samples/versions_client_samples.cc | 59 ++++++++++++++++++ .../artifact_registry_client_samples.cc | 59 ++++++++++++++++++ .../asset/samples/asset_client_samples.cc | 59 ++++++++++++++++++ .../assured_workloads_client_samples.cc | 60 ++++++++++++++++++ .../automl/samples/auto_ml_client_samples.cc | 59 ++++++++++++++++++ .../samples/prediction_client_samples.cc | 59 ++++++++++++++++++ .../bare_metal_solution_client_samples.cc | 60 ++++++++++++++++++ .../batch/samples/batch_client_samples.cc | 59 ++++++++++++++++++ .../samples/app_connections_client_samples.cc | 60 ++++++++++++++++++ .../samples/app_connectors_client_samples.cc | 59 ++++++++++++++++++ .../samples/app_gateways_client_samples.cc | 59 ++++++++++++++++++ ...lient_connector_services_client_samples.cc | 61 +++++++++++++++++++ .../samples/client_gateways_client_samples.cc | 60 ++++++++++++++++++ .../samples/analytics_hub_client_samples.cc | 59 ++++++++++++++++++ .../samples/bigquery_read_client_samples.cc | 59 ++++++++++++++++++ .../samples/bigquery_write_client_samples.cc | 59 ++++++++++++++++++ .../samples/connection_client_samples.cc | 59 ++++++++++++++++++ .../samples/data_transfer_client_samples.cc | 59 ++++++++++++++++++ .../samples/migration_client_samples.cc | 59 ++++++++++++++++++ .../bigquery/samples/model_client_samples.cc | 59 ++++++++++++++++++ .../samples/reservation_client_samples.cc | 59 ++++++++++++++++++ .../bigtable_instance_admin_client_samples.cc | 60 ++++++++++++++++++ .../bigtable_table_admin_client_samples.cc | 59 ++++++++++++++++++ .../billing/samples/budget_client_samples.cc | 59 ++++++++++++++++++ .../samples/cloud_billing_client_samples.cc | 59 ++++++++++++++++++ .../samples/cloud_catalog_client_samples.cc | 59 ++++++++++++++++++ ...hz_management_service_v1_client_samples.cc | 61 +++++++++++++++++++ .../system_policy_v1_client_samples.cc | 60 ++++++++++++++++++ .../validation_helper_v1_client_samples.cc | 60 ++++++++++++++++++ .../certificate_manager_client_samples.cc | 60 ++++++++++++++++++ .../samples/cloud_channel_client_samples.cc | 59 ++++++++++++++++++ .../samples/cloud_build_client_samples.cc | 59 ++++++++++++++++++ .../samples/environments_client_samples.cc | 59 ++++++++++++++++++ .../samples/image_versions_client_samples.cc | 59 ++++++++++++++++++ .../contact_center_insights_client_samples.cc | 61 +++++++++++++++++++ .../samples/cluster_manager_client_samples.cc | 59 ++++++++++++++++++ .../container_analysis_client_samples.cc | 60 ++++++++++++++++++ .../samples/grafeas_client_samples.cc | 59 ++++++++++++++++++ .../samples/data_catalog_client_samples.cc | 59 ++++++++++++++++++ .../policy_tag_manager_client_samples.cc | 59 ++++++++++++++++++ ...ag_manager_serialization_client_samples.cc | 60 ++++++++++++++++++ .../samples/data_migration_client_samples.cc | 60 ++++++++++++++++++ .../samples/content_client_samples.cc | 59 ++++++++++++++++++ .../samples/dataplex_client_samples.cc | 59 ++++++++++++++++++ .../samples/metadata_client_samples.cc | 59 ++++++++++++++++++ .../autoscaling_policy_client_samples.cc | 59 ++++++++++++++++++ .../batch_controller_client_samples.cc | 59 ++++++++++++++++++ .../cluster_controller_client_samples.cc | 59 ++++++++++++++++++ .../samples/job_controller_client_samples.cc | 59 ++++++++++++++++++ .../workflow_template_client_samples.cc | 59 ++++++++++++++++++ .../samples/datastream_client_samples.cc | 59 ++++++++++++++++++ .../samples/controller2_client_samples.cc | 59 ++++++++++++++++++ .../samples/debugger2_client_samples.cc | 59 ++++++++++++++++++ .../samples/cloud_deploy_client_samples.cc | 59 ++++++++++++++++++ .../samples/agents_client_samples.cc | 59 ++++++++++++++++++ .../samples/changelogs_client_samples.cc | 59 ++++++++++++++++++ .../samples/deployments_client_samples.cc | 59 ++++++++++++++++++ .../samples/entity_types_client_samples.cc | 59 ++++++++++++++++++ .../samples/environments_client_samples.cc | 59 ++++++++++++++++++ .../samples/experiments_client_samples.cc | 59 ++++++++++++++++++ .../samples/flows_client_samples.cc | 59 ++++++++++++++++++ .../samples/intents_client_samples.cc | 59 ++++++++++++++++++ .../samples/pages_client_samples.cc | 59 ++++++++++++++++++ .../security_settings_client_samples.cc | 60 ++++++++++++++++++ .../session_entity_types_client_samples.cc | 59 ++++++++++++++++++ .../samples/sessions_client_samples.cc | 59 ++++++++++++++++++ .../samples/test_cases_client_samples.cc | 59 ++++++++++++++++++ .../transition_route_groups_client_samples.cc | 60 ++++++++++++++++++ .../samples/versions_client_samples.cc | 59 ++++++++++++++++++ .../samples/webhooks_client_samples.cc | 59 ++++++++++++++++++ .../samples/agents_client_samples.cc | 59 ++++++++++++++++++ .../samples/answer_records_client_samples.cc | 59 ++++++++++++++++++ .../samples/contexts_client_samples.cc | 59 ++++++++++++++++++ .../conversation_datasets_client_samples.cc | 60 ++++++++++++++++++ .../conversation_models_client_samples.cc | 59 ++++++++++++++++++ .../conversation_profiles_client_samples.cc | 60 ++++++++++++++++++ .../samples/conversations_client_samples.cc | 59 ++++++++++++++++++ .../samples/documents_client_samples.cc | 59 ++++++++++++++++++ .../samples/entity_types_client_samples.cc | 59 ++++++++++++++++++ .../samples/environments_client_samples.cc | 59 ++++++++++++++++++ .../samples/fulfillments_client_samples.cc | 59 ++++++++++++++++++ .../samples/intents_client_samples.cc | 59 ++++++++++++++++++ .../samples/knowledge_bases_client_samples.cc | 59 ++++++++++++++++++ .../samples/participants_client_samples.cc | 59 ++++++++++++++++++ .../session_entity_types_client_samples.cc | 59 ++++++++++++++++++ .../samples/sessions_client_samples.cc | 59 ++++++++++++++++++ .../samples/versions_client_samples.cc | 59 ++++++++++++++++++ .../cloud/dlp/samples/dlp_client_samples.cc | 59 ++++++++++++++++++ .../document_processor_client_samples.cc | 60 ++++++++++++++++++ .../samples/edge_container_client_samples.cc | 59 ++++++++++++++++++ .../samples/eventarc_client_samples.cc | 59 ++++++++++++++++++ .../samples/publisher_client_samples.cc | 59 ++++++++++++++++++ .../cloud_filestore_manager_client_samples.cc | 59 ++++++++++++++++++ .../samples/cloud_functions_client_samples.cc | 59 ++++++++++++++++++ .../game_server_clusters_client_samples.cc | 60 ++++++++++++++++++ .../game_server_configs_client_samples.cc | 60 ++++++++++++++++++ .../game_server_deployments_client_samples.cc | 60 ++++++++++++++++++ .../samples/realms_client_samples.cc | 59 ++++++++++++++++++ .../gkehub/samples/gke_hub_client_samples.cc | 59 ++++++++++++++++++ .../cloud/iam/samples/iam_client_samples.cc | 59 ++++++++++++++++++ .../samples/iam_credentials_client_samples.cc | 59 ++++++++++++++++++ .../iam/samples/iam_policy_client_samples.cc | 59 ++++++++++++++++++ ...entity_aware_proxy_admin_client_samples.cc | 60 ++++++++++++++++++ ...ntity_aware_proxy_o_auth_client_samples.cc | 60 ++++++++++++++++++ .../cloud/ids/samples/ids_client_samples.cc | 59 ++++++++++++++++++ .../samples/device_manager_client_samples.cc | 59 ++++++++++++++++++ .../cloud/kms/samples/ekm_client_samples.cc | 59 ++++++++++++++++++ .../samples/key_management_client_samples.cc | 59 ++++++++++++++++++ .../samples/language_client_samples.cc | 59 ++++++++++++++++++ .../logging_service_v2_client_samples.cc | 59 ++++++++++++++++++ .../managed_identities_client_samples.cc | 61 +++++++++++++++++++ .../samples/cloud_memcache_client_samples.cc | 59 ++++++++++++++++++ .../samples/alert_policy_client_samples.cc | 59 ++++++++++++++++++ .../samples/dashboards_client_samples.cc | 59 ++++++++++++++++++ .../samples/group_client_samples.cc | 59 ++++++++++++++++++ .../samples/metric_client_samples.cc | 59 ++++++++++++++++++ .../samples/metrics_scopes_client_samples.cc | 59 ++++++++++++++++++ .../notification_channel_client_samples.cc | 60 ++++++++++++++++++ .../samples/query_client_samples.cc | 59 ++++++++++++++++++ .../service_monitoring_client_samples.cc | 60 ++++++++++++++++++ .../samples/uptime_check_client_samples.cc | 59 ++++++++++++++++++ .../samples/hub_client_samples.cc | 59 ++++++++++++++++++ .../samples/reachability_client_samples.cc | 60 ++++++++++++++++++ .../managed_notebook_client_samples.cc | 59 ++++++++++++++++++ .../samples/notebook_client_samples.cc | 59 ++++++++++++++++++ .../samples/fleet_routing_client_samples.cc | 59 ++++++++++++++++++ .../samples/org_policy_client_samples.cc | 59 ++++++++++++++++++ .../samples/agent_endpoint_client_samples.cc | 59 ++++++++++++++++++ .../samples/os_config_client_samples.cc | 59 ++++++++++++++++++ .../samples/os_login_client_samples.cc | 59 ++++++++++++++++++ .../samples/iam_checker_client_samples.cc | 59 ++++++++++++++++++ .../certificate_authority_client_samples.cc | 60 ++++++++++++++++++ .../samples/profiler_client_samples.cc | 59 ++++++++++++++++++ .../samples/admin_client_samples.cc | 59 ++++++++++++++++++ .../samples/topic_stats_client_samples.cc | 59 ++++++++++++++++++ .../samples/recommender_client_samples.cc | 59 ++++++++++++++++++ .../samples/cloud_redis_client_samples.cc | 59 ++++++++++++++++++ .../samples/folders_client_samples.cc | 59 ++++++++++++++++++ .../samples/organizations_client_samples.cc | 59 ++++++++++++++++++ .../samples/projects_client_samples.cc | 59 ++++++++++++++++++ .../resource_settings_client_samples.cc | 60 ++++++++++++++++++ .../retail/samples/catalog_client_samples.cc | 59 ++++++++++++++++++ .../samples/completion_client_samples.cc | 59 ++++++++++++++++++ .../samples/prediction_client_samples.cc | 59 ++++++++++++++++++ .../retail/samples/product_client_samples.cc | 59 ++++++++++++++++++ .../retail/samples/search_client_samples.cc | 59 ++++++++++++++++++ .../samples/user_event_client_samples.cc | 59 ++++++++++++++++++ .../run/samples/revisions_client_samples.cc | 59 ++++++++++++++++++ .../run/samples/services_client_samples.cc | 59 ++++++++++++++++++ .../samples/cloud_scheduler_client_samples.cc | 59 ++++++++++++++++++ .../samples/secret_manager_client_samples.cc | 60 ++++++++++++++++++ .../samples/security_center_client_samples.cc | 59 ++++++++++++++++++ .../quota_controller_client_samples.cc | 59 ++++++++++++++++++ .../service_controller_client_samples.cc | 59 ++++++++++++++++++ .../samples/lookup_client_samples.cc | 59 ++++++++++++++++++ .../samples/registration_client_samples.cc | 60 ++++++++++++++++++ .../samples/service_manager_client_samples.cc | 59 ++++++++++++++++++ .../samples/service_usage_client_samples.cc | 59 ++++++++++++++++++ .../samples/cloud_shell_client_samples.cc | 59 ++++++++++++++++++ .../samples/database_admin_client_samples.cc | 59 ++++++++++++++++++ .../samples/instance_admin_client_samples.cc | 59 ++++++++++++++++++ .../speech/samples/speech_client_samples.cc | 59 ++++++++++++++++++ .../storage_transfer_client_samples.cc | 60 ++++++++++++++++++ .../talent/samples/company_client_samples.cc | 59 ++++++++++++++++++ .../samples/completion_client_samples.cc | 59 ++++++++++++++++++ .../talent/samples/event_client_samples.cc | 59 ++++++++++++++++++ .../talent/samples/job_client_samples.cc | 59 ++++++++++++++++++ .../talent/samples/tenant_client_samples.cc | 59 ++++++++++++++++++ .../samples/cloud_tasks_client_samples.cc | 59 ++++++++++++++++++ .../samples/text_to_speech_client_samples.cc | 59 ++++++++++++++++++ .../cloud/tpu/samples/tpu_client_samples.cc | 59 ++++++++++++++++++ .../trace/samples/trace_client_samples.cc | 59 ++++++++++++++++++ .../samples/translation_client_samples.cc | 59 ++++++++++++++++++ .../samples/livestream_client_samples.cc | 59 ++++++++++++++++++ .../samples/transcoder_client_samples.cc | 59 ++++++++++++++++++ .../samples/video_stitcher_client_samples.cc | 59 ++++++++++++++++++ .../video_intelligence_client_samples.cc | 61 +++++++++++++++++++ .../samples/image_annotator_client_samples.cc | 59 ++++++++++++++++++ .../samples/product_search_client_samples.cc | 59 ++++++++++++++++++ .../samples/vm_migration_client_samples.cc | 59 ++++++++++++++++++ .../samples/vpc_access_client_samples.cc | 59 ++++++++++++++++++ .../samples/web_risk_client_samples.cc | 59 ++++++++++++++++++ .../web_security_scanner_client_samples.cc | 60 ++++++++++++++++++ .../samples/executions_client_samples.cc | 59 ++++++++++++++++++ .../samples/workflows_client_samples.cc | 59 ++++++++++++++++++ 197 files changed, 11664 insertions(+) create mode 100644 google/cloud/accessapproval/samples/access_approval_client_samples.cc create mode 100644 google/cloud/accesscontextmanager/samples/access_context_manager_client_samples.cc create mode 100644 google/cloud/apigateway/samples/api_gateway_client_samples.cc create mode 100644 google/cloud/apigeeconnect/samples/connection_client_samples.cc create mode 100644 google/cloud/apikeys/samples/api_keys_client_samples.cc create mode 100644 google/cloud/appengine/samples/applications_client_samples.cc create mode 100644 google/cloud/appengine/samples/authorized_certificates_client_samples.cc create mode 100644 google/cloud/appengine/samples/authorized_domains_client_samples.cc create mode 100644 google/cloud/appengine/samples/domain_mappings_client_samples.cc create mode 100644 google/cloud/appengine/samples/firewall_client_samples.cc create mode 100644 google/cloud/appengine/samples/instances_client_samples.cc create mode 100644 google/cloud/appengine/samples/services_client_samples.cc create mode 100644 google/cloud/appengine/samples/versions_client_samples.cc create mode 100644 google/cloud/artifactregistry/samples/artifact_registry_client_samples.cc create mode 100644 google/cloud/asset/samples/asset_client_samples.cc create mode 100644 google/cloud/assuredworkloads/samples/assured_workloads_client_samples.cc create mode 100644 google/cloud/automl/samples/auto_ml_client_samples.cc create mode 100644 google/cloud/automl/samples/prediction_client_samples.cc create mode 100644 google/cloud/baremetalsolution/samples/bare_metal_solution_client_samples.cc create mode 100644 google/cloud/batch/samples/batch_client_samples.cc create mode 100644 google/cloud/beyondcorp/samples/app_connections_client_samples.cc create mode 100644 google/cloud/beyondcorp/samples/app_connectors_client_samples.cc create mode 100644 google/cloud/beyondcorp/samples/app_gateways_client_samples.cc create mode 100644 google/cloud/beyondcorp/samples/client_connector_services_client_samples.cc create mode 100644 google/cloud/beyondcorp/samples/client_gateways_client_samples.cc create mode 100644 google/cloud/bigquery/samples/analytics_hub_client_samples.cc create mode 100644 google/cloud/bigquery/samples/bigquery_read_client_samples.cc create mode 100644 google/cloud/bigquery/samples/bigquery_write_client_samples.cc create mode 100644 google/cloud/bigquery/samples/connection_client_samples.cc create mode 100644 google/cloud/bigquery/samples/data_transfer_client_samples.cc create mode 100644 google/cloud/bigquery/samples/migration_client_samples.cc create mode 100644 google/cloud/bigquery/samples/model_client_samples.cc create mode 100644 google/cloud/bigquery/samples/reservation_client_samples.cc create mode 100644 google/cloud/bigtable/admin/samples/bigtable_instance_admin_client_samples.cc create mode 100644 google/cloud/bigtable/admin/samples/bigtable_table_admin_client_samples.cc create mode 100644 google/cloud/billing/samples/budget_client_samples.cc create mode 100644 google/cloud/billing/samples/cloud_billing_client_samples.cc create mode 100644 google/cloud/billing/samples/cloud_catalog_client_samples.cc create mode 100644 google/cloud/binaryauthorization/samples/binauthz_management_service_v1_client_samples.cc create mode 100644 google/cloud/binaryauthorization/samples/system_policy_v1_client_samples.cc create mode 100644 google/cloud/binaryauthorization/samples/validation_helper_v1_client_samples.cc create mode 100644 google/cloud/certificatemanager/samples/certificate_manager_client_samples.cc create mode 100644 google/cloud/channel/samples/cloud_channel_client_samples.cc create mode 100644 google/cloud/cloudbuild/samples/cloud_build_client_samples.cc create mode 100644 google/cloud/composer/samples/environments_client_samples.cc create mode 100644 google/cloud/composer/samples/image_versions_client_samples.cc create mode 100644 google/cloud/contactcenterinsights/samples/contact_center_insights_client_samples.cc create mode 100644 google/cloud/container/samples/cluster_manager_client_samples.cc create mode 100644 google/cloud/containeranalysis/samples/container_analysis_client_samples.cc create mode 100644 google/cloud/containeranalysis/samples/grafeas_client_samples.cc create mode 100644 google/cloud/datacatalog/samples/data_catalog_client_samples.cc create mode 100644 google/cloud/datacatalog/samples/policy_tag_manager_client_samples.cc create mode 100644 google/cloud/datacatalog/samples/policy_tag_manager_serialization_client_samples.cc create mode 100644 google/cloud/datamigration/samples/data_migration_client_samples.cc create mode 100644 google/cloud/dataplex/samples/content_client_samples.cc create mode 100644 google/cloud/dataplex/samples/dataplex_client_samples.cc create mode 100644 google/cloud/dataplex/samples/metadata_client_samples.cc create mode 100644 google/cloud/dataproc/samples/autoscaling_policy_client_samples.cc create mode 100644 google/cloud/dataproc/samples/batch_controller_client_samples.cc create mode 100644 google/cloud/dataproc/samples/cluster_controller_client_samples.cc create mode 100644 google/cloud/dataproc/samples/job_controller_client_samples.cc create mode 100644 google/cloud/dataproc/samples/workflow_template_client_samples.cc create mode 100644 google/cloud/datastream/samples/datastream_client_samples.cc create mode 100644 google/cloud/debugger/samples/controller2_client_samples.cc create mode 100644 google/cloud/debugger/samples/debugger2_client_samples.cc create mode 100644 google/cloud/deploy/samples/cloud_deploy_client_samples.cc create mode 100644 google/cloud/dialogflow_cx/samples/agents_client_samples.cc create mode 100644 google/cloud/dialogflow_cx/samples/changelogs_client_samples.cc create mode 100644 google/cloud/dialogflow_cx/samples/deployments_client_samples.cc create mode 100644 google/cloud/dialogflow_cx/samples/entity_types_client_samples.cc create mode 100644 google/cloud/dialogflow_cx/samples/environments_client_samples.cc create mode 100644 google/cloud/dialogflow_cx/samples/experiments_client_samples.cc create mode 100644 google/cloud/dialogflow_cx/samples/flows_client_samples.cc create mode 100644 google/cloud/dialogflow_cx/samples/intents_client_samples.cc create mode 100644 google/cloud/dialogflow_cx/samples/pages_client_samples.cc create mode 100644 google/cloud/dialogflow_cx/samples/security_settings_client_samples.cc create mode 100644 google/cloud/dialogflow_cx/samples/session_entity_types_client_samples.cc create mode 100644 google/cloud/dialogflow_cx/samples/sessions_client_samples.cc create mode 100644 google/cloud/dialogflow_cx/samples/test_cases_client_samples.cc create mode 100644 google/cloud/dialogflow_cx/samples/transition_route_groups_client_samples.cc create mode 100644 google/cloud/dialogflow_cx/samples/versions_client_samples.cc create mode 100644 google/cloud/dialogflow_cx/samples/webhooks_client_samples.cc create mode 100644 google/cloud/dialogflow_es/samples/agents_client_samples.cc create mode 100644 google/cloud/dialogflow_es/samples/answer_records_client_samples.cc create mode 100644 google/cloud/dialogflow_es/samples/contexts_client_samples.cc create mode 100644 google/cloud/dialogflow_es/samples/conversation_datasets_client_samples.cc create mode 100644 google/cloud/dialogflow_es/samples/conversation_models_client_samples.cc create mode 100644 google/cloud/dialogflow_es/samples/conversation_profiles_client_samples.cc create mode 100644 google/cloud/dialogflow_es/samples/conversations_client_samples.cc create mode 100644 google/cloud/dialogflow_es/samples/documents_client_samples.cc create mode 100644 google/cloud/dialogflow_es/samples/entity_types_client_samples.cc create mode 100644 google/cloud/dialogflow_es/samples/environments_client_samples.cc create mode 100644 google/cloud/dialogflow_es/samples/fulfillments_client_samples.cc create mode 100644 google/cloud/dialogflow_es/samples/intents_client_samples.cc create mode 100644 google/cloud/dialogflow_es/samples/knowledge_bases_client_samples.cc create mode 100644 google/cloud/dialogflow_es/samples/participants_client_samples.cc create mode 100644 google/cloud/dialogflow_es/samples/session_entity_types_client_samples.cc create mode 100644 google/cloud/dialogflow_es/samples/sessions_client_samples.cc create mode 100644 google/cloud/dialogflow_es/samples/versions_client_samples.cc create mode 100644 google/cloud/dlp/samples/dlp_client_samples.cc create mode 100644 google/cloud/documentai/samples/document_processor_client_samples.cc create mode 100644 google/cloud/edgecontainer/samples/edge_container_client_samples.cc create mode 100644 google/cloud/eventarc/samples/eventarc_client_samples.cc create mode 100644 google/cloud/eventarc/samples/publisher_client_samples.cc create mode 100644 google/cloud/filestore/samples/cloud_filestore_manager_client_samples.cc create mode 100644 google/cloud/functions/samples/cloud_functions_client_samples.cc create mode 100644 google/cloud/gameservices/samples/game_server_clusters_client_samples.cc create mode 100644 google/cloud/gameservices/samples/game_server_configs_client_samples.cc create mode 100644 google/cloud/gameservices/samples/game_server_deployments_client_samples.cc create mode 100644 google/cloud/gameservices/samples/realms_client_samples.cc create mode 100644 google/cloud/gkehub/samples/gke_hub_client_samples.cc create mode 100644 google/cloud/iam/samples/iam_client_samples.cc create mode 100644 google/cloud/iam/samples/iam_credentials_client_samples.cc create mode 100644 google/cloud/iam/samples/iam_policy_client_samples.cc create mode 100644 google/cloud/iap/samples/identity_aware_proxy_admin_client_samples.cc create mode 100644 google/cloud/iap/samples/identity_aware_proxy_o_auth_client_samples.cc create mode 100644 google/cloud/ids/samples/ids_client_samples.cc create mode 100644 google/cloud/iot/samples/device_manager_client_samples.cc create mode 100644 google/cloud/kms/samples/ekm_client_samples.cc create mode 100644 google/cloud/kms/samples/key_management_client_samples.cc create mode 100644 google/cloud/language/samples/language_client_samples.cc create mode 100644 google/cloud/logging/samples/logging_service_v2_client_samples.cc create mode 100644 google/cloud/managedidentities/samples/managed_identities_client_samples.cc create mode 100644 google/cloud/memcache/samples/cloud_memcache_client_samples.cc create mode 100644 google/cloud/monitoring/samples/alert_policy_client_samples.cc create mode 100644 google/cloud/monitoring/samples/dashboards_client_samples.cc create mode 100644 google/cloud/monitoring/samples/group_client_samples.cc create mode 100644 google/cloud/monitoring/samples/metric_client_samples.cc create mode 100644 google/cloud/monitoring/samples/metrics_scopes_client_samples.cc create mode 100644 google/cloud/monitoring/samples/notification_channel_client_samples.cc create mode 100644 google/cloud/monitoring/samples/query_client_samples.cc create mode 100644 google/cloud/monitoring/samples/service_monitoring_client_samples.cc create mode 100644 google/cloud/monitoring/samples/uptime_check_client_samples.cc create mode 100644 google/cloud/networkconnectivity/samples/hub_client_samples.cc create mode 100644 google/cloud/networkmanagement/samples/reachability_client_samples.cc create mode 100644 google/cloud/notebooks/samples/managed_notebook_client_samples.cc create mode 100644 google/cloud/notebooks/samples/notebook_client_samples.cc create mode 100644 google/cloud/optimization/samples/fleet_routing_client_samples.cc create mode 100644 google/cloud/orgpolicy/samples/org_policy_client_samples.cc create mode 100644 google/cloud/osconfig/samples/agent_endpoint_client_samples.cc create mode 100644 google/cloud/osconfig/samples/os_config_client_samples.cc create mode 100644 google/cloud/oslogin/samples/os_login_client_samples.cc create mode 100644 google/cloud/policytroubleshooter/samples/iam_checker_client_samples.cc create mode 100644 google/cloud/privateca/samples/certificate_authority_client_samples.cc create mode 100644 google/cloud/profiler/samples/profiler_client_samples.cc create mode 100644 google/cloud/pubsublite/samples/admin_client_samples.cc create mode 100644 google/cloud/pubsublite/samples/topic_stats_client_samples.cc create mode 100644 google/cloud/recommender/samples/recommender_client_samples.cc create mode 100644 google/cloud/redis/samples/cloud_redis_client_samples.cc create mode 100644 google/cloud/resourcemanager/samples/folders_client_samples.cc create mode 100644 google/cloud/resourcemanager/samples/organizations_client_samples.cc create mode 100644 google/cloud/resourcemanager/samples/projects_client_samples.cc create mode 100644 google/cloud/resourcesettings/samples/resource_settings_client_samples.cc create mode 100644 google/cloud/retail/samples/catalog_client_samples.cc create mode 100644 google/cloud/retail/samples/completion_client_samples.cc create mode 100644 google/cloud/retail/samples/prediction_client_samples.cc create mode 100644 google/cloud/retail/samples/product_client_samples.cc create mode 100644 google/cloud/retail/samples/search_client_samples.cc create mode 100644 google/cloud/retail/samples/user_event_client_samples.cc create mode 100644 google/cloud/run/samples/revisions_client_samples.cc create mode 100644 google/cloud/run/samples/services_client_samples.cc create mode 100644 google/cloud/scheduler/samples/cloud_scheduler_client_samples.cc create mode 100644 google/cloud/secretmanager/samples/secret_manager_client_samples.cc create mode 100644 google/cloud/securitycenter/samples/security_center_client_samples.cc create mode 100644 google/cloud/servicecontrol/samples/quota_controller_client_samples.cc create mode 100644 google/cloud/servicecontrol/samples/service_controller_client_samples.cc create mode 100644 google/cloud/servicedirectory/samples/lookup_client_samples.cc create mode 100644 google/cloud/servicedirectory/samples/registration_client_samples.cc create mode 100644 google/cloud/servicemanagement/samples/service_manager_client_samples.cc create mode 100644 google/cloud/serviceusage/samples/service_usage_client_samples.cc create mode 100644 google/cloud/shell/samples/cloud_shell_client_samples.cc create mode 100644 google/cloud/spanner/admin/samples/database_admin_client_samples.cc create mode 100644 google/cloud/spanner/admin/samples/instance_admin_client_samples.cc create mode 100644 google/cloud/speech/samples/speech_client_samples.cc create mode 100644 google/cloud/storagetransfer/samples/storage_transfer_client_samples.cc create mode 100644 google/cloud/talent/samples/company_client_samples.cc create mode 100644 google/cloud/talent/samples/completion_client_samples.cc create mode 100644 google/cloud/talent/samples/event_client_samples.cc create mode 100644 google/cloud/talent/samples/job_client_samples.cc create mode 100644 google/cloud/talent/samples/tenant_client_samples.cc create mode 100644 google/cloud/tasks/samples/cloud_tasks_client_samples.cc create mode 100644 google/cloud/texttospeech/samples/text_to_speech_client_samples.cc create mode 100644 google/cloud/tpu/samples/tpu_client_samples.cc create mode 100644 google/cloud/trace/samples/trace_client_samples.cc create mode 100644 google/cloud/translate/samples/translation_client_samples.cc create mode 100644 google/cloud/video/samples/livestream_client_samples.cc create mode 100644 google/cloud/video/samples/transcoder_client_samples.cc create mode 100644 google/cloud/video/samples/video_stitcher_client_samples.cc create mode 100644 google/cloud/videointelligence/samples/video_intelligence_client_samples.cc create mode 100644 google/cloud/vision/samples/image_annotator_client_samples.cc create mode 100644 google/cloud/vision/samples/product_search_client_samples.cc create mode 100644 google/cloud/vmmigration/samples/vm_migration_client_samples.cc create mode 100644 google/cloud/vpcaccess/samples/vpc_access_client_samples.cc create mode 100644 google/cloud/webrisk/samples/web_risk_client_samples.cc create mode 100644 google/cloud/websecurityscanner/samples/web_security_scanner_client_samples.cc create mode 100644 google/cloud/workflows/samples/executions_client_samples.cc create mode 100644 google/cloud/workflows/samples/workflows_client_samples.cc diff --git a/google/cloud/accessapproval/samples/access_approval_client_samples.cc b/google/cloud/accessapproval/samples/access_approval_client_samples.cc new file mode 100644 index 0000000000000..d934c047ed62a --- /dev/null +++ b/google/cloud/accessapproval/samples/access_approval_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/accessapproval/v1/accessapproval.proto + +#include "google/cloud/accessapproval/access_approval_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::accessapproval::AccessApprovalClient( + google::cloud::accessapproval::MakeAccessApprovalConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AccessApprovalClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/accesscontextmanager/samples/access_context_manager_client_samples.cc b/google/cloud/accesscontextmanager/samples/access_context_manager_client_samples.cc new file mode 100644 index 0000000000000..8e882494c80d0 --- /dev/null +++ b/google/cloud/accesscontextmanager/samples/access_context_manager_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/identity/accesscontextmanager/v1/access_context_manager.proto + +#include "google/cloud/accesscontextmanager/access_context_manager_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::accesscontextmanager::AccessContextManagerClient( + google::cloud::accesscontextmanager::MakeAccessContextManagerConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AccessContextManagerClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/apigateway/samples/api_gateway_client_samples.cc b/google/cloud/apigateway/samples/api_gateway_client_samples.cc new file mode 100644 index 0000000000000..7f5e880cf919b --- /dev/null +++ b/google/cloud/apigateway/samples/api_gateway_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/apigateway/v1/apigateway_service.proto + +#include "google/cloud/apigateway/api_gateway_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::apigateway::ApiGatewayServiceClient( + google::cloud::apigateway::MakeApiGatewayServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ApiGatewayServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/apigeeconnect/samples/connection_client_samples.cc b/google/cloud/apigeeconnect/samples/connection_client_samples.cc new file mode 100644 index 0000000000000..da7baf36c1716 --- /dev/null +++ b/google/cloud/apigeeconnect/samples/connection_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/apigeeconnect/v1/connection.proto + +#include "google/cloud/apigeeconnect/connection_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::apigeeconnect::ConnectionServiceClient( + google::cloud::apigeeconnect::MakeConnectionServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ConnectionServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/apikeys/samples/api_keys_client_samples.cc b/google/cloud/apikeys/samples/api_keys_client_samples.cc new file mode 100644 index 0000000000000..ea8e3a3130502 --- /dev/null +++ b/google/cloud/apikeys/samples/api_keys_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/api/apikeys/v2/apikeys.proto + +#include "google/cloud/apikeys/api_keys_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::apikeys::ApiKeysClient( + google::cloud::apikeys::MakeApiKeysConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ApiKeysClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/appengine/samples/applications_client_samples.cc b/google/cloud/appengine/samples/applications_client_samples.cc new file mode 100644 index 0000000000000..c99989c67ca2d --- /dev/null +++ b/google/cloud/appengine/samples/applications_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/appengine/v1/appengine.proto + +#include "google/cloud/appengine/applications_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::appengine::ApplicationsClient( + google::cloud::appengine::MakeApplicationsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ApplicationsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/appengine/samples/authorized_certificates_client_samples.cc b/google/cloud/appengine/samples/authorized_certificates_client_samples.cc new file mode 100644 index 0000000000000..8c2f2f3ccd327 --- /dev/null +++ b/google/cloud/appengine/samples/authorized_certificates_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/appengine/v1/appengine.proto + +#include "google/cloud/appengine/authorized_certificates_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::appengine::AuthorizedCertificatesClient( + google::cloud::appengine::MakeAuthorizedCertificatesConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AuthorizedCertificatesClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/appengine/samples/authorized_domains_client_samples.cc b/google/cloud/appengine/samples/authorized_domains_client_samples.cc new file mode 100644 index 0000000000000..ccdc42336dfcf --- /dev/null +++ b/google/cloud/appengine/samples/authorized_domains_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/appengine/v1/appengine.proto + +#include "google/cloud/appengine/authorized_domains_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::appengine::AuthorizedDomainsClient( + google::cloud::appengine::MakeAuthorizedDomainsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AuthorizedDomainsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/appengine/samples/domain_mappings_client_samples.cc b/google/cloud/appengine/samples/domain_mappings_client_samples.cc new file mode 100644 index 0000000000000..ee06c03ca6bf1 --- /dev/null +++ b/google/cloud/appengine/samples/domain_mappings_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/appengine/v1/appengine.proto + +#include "google/cloud/appengine/domain_mappings_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::appengine::DomainMappingsClient( + google::cloud::appengine::MakeDomainMappingsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: DomainMappingsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/appengine/samples/firewall_client_samples.cc b/google/cloud/appengine/samples/firewall_client_samples.cc new file mode 100644 index 0000000000000..f0e2f13a407cb --- /dev/null +++ b/google/cloud/appengine/samples/firewall_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/appengine/v1/appengine.proto + +#include "google/cloud/appengine/firewall_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::appengine::FirewallClient( + google::cloud::appengine::MakeFirewallConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: FirewallClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/appengine/samples/instances_client_samples.cc b/google/cloud/appengine/samples/instances_client_samples.cc new file mode 100644 index 0000000000000..76d771d18d68e --- /dev/null +++ b/google/cloud/appengine/samples/instances_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/appengine/v1/appengine.proto + +#include "google/cloud/appengine/instances_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::appengine::InstancesClient( + google::cloud::appengine::MakeInstancesConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: InstancesClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/appengine/samples/services_client_samples.cc b/google/cloud/appengine/samples/services_client_samples.cc new file mode 100644 index 0000000000000..a8665b436178b --- /dev/null +++ b/google/cloud/appengine/samples/services_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/appengine/v1/appengine.proto + +#include "google/cloud/appengine/services_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::appengine::ServicesClient( + google::cloud::appengine::MakeServicesConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ServicesClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/appengine/samples/versions_client_samples.cc b/google/cloud/appengine/samples/versions_client_samples.cc new file mode 100644 index 0000000000000..33fba52eaaa56 --- /dev/null +++ b/google/cloud/appengine/samples/versions_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/appengine/v1/appengine.proto + +#include "google/cloud/appengine/versions_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::appengine::VersionsClient( + google::cloud::appengine::MakeVersionsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: VersionsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/artifactregistry/samples/artifact_registry_client_samples.cc b/google/cloud/artifactregistry/samples/artifact_registry_client_samples.cc new file mode 100644 index 0000000000000..92d4d83326b0b --- /dev/null +++ b/google/cloud/artifactregistry/samples/artifact_registry_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/devtools/artifactregistry/v1/service.proto + +#include "google/cloud/artifactregistry/artifact_registry_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::artifactregistry::ArtifactRegistryClient( + google::cloud::artifactregistry::MakeArtifactRegistryConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ArtifactRegistryClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/asset/samples/asset_client_samples.cc b/google/cloud/asset/samples/asset_client_samples.cc new file mode 100644 index 0000000000000..aeba41794e6ae --- /dev/null +++ b/google/cloud/asset/samples/asset_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/asset/v1/asset_service.proto + +#include "google/cloud/asset/asset_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::asset::AssetServiceClient( + google::cloud::asset::MakeAssetServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AssetServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/assuredworkloads/samples/assured_workloads_client_samples.cc b/google/cloud/assuredworkloads/samples/assured_workloads_client_samples.cc new file mode 100644 index 0000000000000..ceac38fdb5599 --- /dev/null +++ b/google/cloud/assuredworkloads/samples/assured_workloads_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +#include "google/cloud/assuredworkloads/assured_workloads_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::assuredworkloads::AssuredWorkloadsServiceClient( + google::cloud::assuredworkloads::MakeAssuredWorkloadsServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AssuredWorkloadsServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/automl/samples/auto_ml_client_samples.cc b/google/cloud/automl/samples/auto_ml_client_samples.cc new file mode 100644 index 0000000000000..637a1001ec1cf --- /dev/null +++ b/google/cloud/automl/samples/auto_ml_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/automl/v1/service.proto + +#include "google/cloud/automl/auto_ml_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::automl::AutoMlClient( + google::cloud::automl::MakeAutoMlConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AutoMlClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/automl/samples/prediction_client_samples.cc b/google/cloud/automl/samples/prediction_client_samples.cc new file mode 100644 index 0000000000000..e9a9b3925bfd4 --- /dev/null +++ b/google/cloud/automl/samples/prediction_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/automl/v1/prediction_service.proto + +#include "google/cloud/automl/prediction_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::automl::PredictionServiceClient( + google::cloud::automl::MakePredictionServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: PredictionServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/baremetalsolution/samples/bare_metal_solution_client_samples.cc b/google/cloud/baremetalsolution/samples/bare_metal_solution_client_samples.cc new file mode 100644 index 0000000000000..3f2267fa537bb --- /dev/null +++ b/google/cloud/baremetalsolution/samples/bare_metal_solution_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/baremetalsolution/v2/baremetalsolution.proto + +#include "google/cloud/baremetalsolution/bare_metal_solution_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::baremetalsolution::BareMetalSolutionClient( + google::cloud::baremetalsolution::MakeBareMetalSolutionConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: BareMetalSolutionClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/batch/samples/batch_client_samples.cc b/google/cloud/batch/samples/batch_client_samples.cc new file mode 100644 index 0000000000000..e9466548587ff --- /dev/null +++ b/google/cloud/batch/samples/batch_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/batch/v1/batch.proto + +#include "google/cloud/batch/batch_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::batch::BatchServiceClient( + google::cloud::batch::MakeBatchServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: BatchServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/beyondcorp/samples/app_connections_client_samples.cc b/google/cloud/beyondcorp/samples/app_connections_client_samples.cc new file mode 100644 index 0000000000000..e8af45b994284 --- /dev/null +++ b/google/cloud/beyondcorp/samples/app_connections_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: +// google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto + +#include "google/cloud/beyondcorp/app_connections_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::beyondcorp::AppConnectionsServiceClient( + google::cloud::beyondcorp::MakeAppConnectionsServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AppConnectionsServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/beyondcorp/samples/app_connectors_client_samples.cc b/google/cloud/beyondcorp/samples/app_connectors_client_samples.cc new file mode 100644 index 0000000000000..56fd5d56bfa82 --- /dev/null +++ b/google/cloud/beyondcorp/samples/app_connectors_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.proto + +#include "google/cloud/beyondcorp/app_connectors_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::beyondcorp::AppConnectorsServiceClient( + google::cloud::beyondcorp::MakeAppConnectorsServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AppConnectorsServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/beyondcorp/samples/app_gateways_client_samples.cc b/google/cloud/beyondcorp/samples/app_gateways_client_samples.cc new file mode 100644 index 0000000000000..0d2e692e0cf84 --- /dev/null +++ b/google/cloud/beyondcorp/samples/app_gateways_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto + +#include "google/cloud/beyondcorp/app_gateways_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::beyondcorp::AppGatewaysServiceClient( + google::cloud::beyondcorp::MakeAppGatewaysServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AppGatewaysServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/beyondcorp/samples/client_connector_services_client_samples.cc b/google/cloud/beyondcorp/samples/client_connector_services_client_samples.cc new file mode 100644 index 0000000000000..3fe941089a7c8 --- /dev/null +++ b/google/cloud/beyondcorp/samples/client_connector_services_client_samples.cc @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: +// google/cloud/beyondcorp/clientconnectorservices/v1/client_connector_services_service.proto + +#include "google/cloud/beyondcorp/client_connector_services_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::beyondcorp::ClientConnectorServicesServiceClient( + google::cloud::beyondcorp::MakeClientConnectorServicesServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ClientConnectorServicesServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/beyondcorp/samples/client_gateways_client_samples.cc b/google/cloud/beyondcorp/samples/client_gateways_client_samples.cc new file mode 100644 index 0000000000000..6767ab42aa4d6 --- /dev/null +++ b/google/cloud/beyondcorp/samples/client_gateways_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: +// google/cloud/beyondcorp/clientgateways/v1/client_gateways_service.proto + +#include "google/cloud/beyondcorp/client_gateways_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::beyondcorp::ClientGatewaysServiceClient( + google::cloud::beyondcorp::MakeClientGatewaysServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ClientGatewaysServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/bigquery/samples/analytics_hub_client_samples.cc b/google/cloud/bigquery/samples/analytics_hub_client_samples.cc new file mode 100644 index 0000000000000..5a9546643787b --- /dev/null +++ b/google/cloud/bigquery/samples/analytics_hub_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/bigquery/analyticshub/v1/analyticshub.proto + +#include "google/cloud/bigquery/analytics_hub_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::bigquery::AnalyticsHubServiceClient( + google::cloud::bigquery::MakeAnalyticsHubServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AnalyticsHubServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/bigquery/samples/bigquery_read_client_samples.cc b/google/cloud/bigquery/samples/bigquery_read_client_samples.cc new file mode 100644 index 0000000000000..36efaa994ad24 --- /dev/null +++ b/google/cloud/bigquery/samples/bigquery_read_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/bigquery/storage/v1/storage.proto + +#include "google/cloud/bigquery/bigquery_read_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::bigquery::BigQueryReadClient( + google::cloud::bigquery::MakeBigQueryReadConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: BigQueryReadClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/bigquery/samples/bigquery_write_client_samples.cc b/google/cloud/bigquery/samples/bigquery_write_client_samples.cc new file mode 100644 index 0000000000000..f9a572e94097f --- /dev/null +++ b/google/cloud/bigquery/samples/bigquery_write_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/bigquery/storage/v1/storage.proto + +#include "google/cloud/bigquery/bigquery_write_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::bigquery::BigQueryWriteClient( + google::cloud::bigquery::MakeBigQueryWriteConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: BigQueryWriteClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/bigquery/samples/connection_client_samples.cc b/google/cloud/bigquery/samples/connection_client_samples.cc new file mode 100644 index 0000000000000..ff8f153c78606 --- /dev/null +++ b/google/cloud/bigquery/samples/connection_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/bigquery/connection/v1/connection.proto + +#include "google/cloud/bigquery/connection_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::bigquery::ConnectionServiceClient( + google::cloud::bigquery::MakeConnectionServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ConnectionServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/bigquery/samples/data_transfer_client_samples.cc b/google/cloud/bigquery/samples/data_transfer_client_samples.cc new file mode 100644 index 0000000000000..2f9febfd1f5f1 --- /dev/null +++ b/google/cloud/bigquery/samples/data_transfer_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/bigquery/datatransfer/v1/datatransfer.proto + +#include "google/cloud/bigquery/data_transfer_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::bigquery::DataTransferServiceClient( + google::cloud::bigquery::MakeDataTransferServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: DataTransferServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/bigquery/samples/migration_client_samples.cc b/google/cloud/bigquery/samples/migration_client_samples.cc new file mode 100644 index 0000000000000..7493fbde2a0bf --- /dev/null +++ b/google/cloud/bigquery/samples/migration_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/bigquery/migration/v2/migration_service.proto + +#include "google/cloud/bigquery/migration_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::bigquery::MigrationServiceClient( + google::cloud::bigquery::MakeMigrationServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: MigrationServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/bigquery/samples/model_client_samples.cc b/google/cloud/bigquery/samples/model_client_samples.cc new file mode 100644 index 0000000000000..456193b123fa1 --- /dev/null +++ b/google/cloud/bigquery/samples/model_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/bigquery/v2/model.proto + +#include "google/cloud/bigquery/model_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::bigquery::ModelServiceClient( + google::cloud::bigquery::MakeModelServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ModelServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/bigquery/samples/reservation_client_samples.cc b/google/cloud/bigquery/samples/reservation_client_samples.cc new file mode 100644 index 0000000000000..a03ca771f31a8 --- /dev/null +++ b/google/cloud/bigquery/samples/reservation_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/bigquery/reservation/v1/reservation.proto + +#include "google/cloud/bigquery/reservation_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::bigquery::ReservationServiceClient( + google::cloud::bigquery::MakeReservationServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ReservationServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/bigtable/admin/samples/bigtable_instance_admin_client_samples.cc b/google/cloud/bigtable/admin/samples/bigtable_instance_admin_client_samples.cc new file mode 100644 index 0000000000000..c59232bb1d1b1 --- /dev/null +++ b/google/cloud/bigtable/admin/samples/bigtable_instance_admin_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto + +#include "google/cloud/bigtable/admin/bigtable_instance_admin_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::bigtable_admin::BigtableInstanceAdminClient( + google::cloud::bigtable_admin::MakeBigtableInstanceAdminConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: BigtableInstanceAdminClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/bigtable/admin/samples/bigtable_table_admin_client_samples.cc b/google/cloud/bigtable/admin/samples/bigtable_table_admin_client_samples.cc new file mode 100644 index 0000000000000..abcce526200ea --- /dev/null +++ b/google/cloud/bigtable/admin/samples/bigtable_table_admin_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +#include "google/cloud/bigtable/admin/bigtable_table_admin_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::bigtable_admin::BigtableTableAdminClient( + google::cloud::bigtable_admin::MakeBigtableTableAdminConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: BigtableTableAdminClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/billing/samples/budget_client_samples.cc b/google/cloud/billing/samples/budget_client_samples.cc new file mode 100644 index 0000000000000..d0d251904fd10 --- /dev/null +++ b/google/cloud/billing/samples/budget_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/billing/budgets/v1/budget_service.proto + +#include "google/cloud/billing/budget_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::billing::BudgetServiceClient( + google::cloud::billing::MakeBudgetServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: BudgetServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/billing/samples/cloud_billing_client_samples.cc b/google/cloud/billing/samples/cloud_billing_client_samples.cc new file mode 100644 index 0000000000000..723fb194a706a --- /dev/null +++ b/google/cloud/billing/samples/cloud_billing_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/billing/v1/cloud_billing.proto + +#include "google/cloud/billing/cloud_billing_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::billing::CloudBillingClient( + google::cloud::billing::MakeCloudBillingConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CloudBillingClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/billing/samples/cloud_catalog_client_samples.cc b/google/cloud/billing/samples/cloud_catalog_client_samples.cc new file mode 100644 index 0000000000000..1ce532fc3bbcd --- /dev/null +++ b/google/cloud/billing/samples/cloud_catalog_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/billing/v1/cloud_catalog.proto + +#include "google/cloud/billing/cloud_catalog_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::billing::CloudCatalogClient( + google::cloud::billing::MakeCloudCatalogConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CloudCatalogClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/binaryauthorization/samples/binauthz_management_service_v1_client_samples.cc b/google/cloud/binaryauthorization/samples/binauthz_management_service_v1_client_samples.cc new file mode 100644 index 0000000000000..3551e2713f65e --- /dev/null +++ b/google/cloud/binaryauthorization/samples/binauthz_management_service_v1_client_samples.cc @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/binaryauthorization/v1/service.proto + +#include "google/cloud/binaryauthorization/binauthz_management_service_v1_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = + google::cloud::binaryauthorization::BinauthzManagementServiceV1Client( + google::cloud::binaryauthorization:: + MakeBinauthzManagementServiceV1Connection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: BinauthzManagementServiceV1Client +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/binaryauthorization/samples/system_policy_v1_client_samples.cc b/google/cloud/binaryauthorization/samples/system_policy_v1_client_samples.cc new file mode 100644 index 0000000000000..66bafc37ea2b0 --- /dev/null +++ b/google/cloud/binaryauthorization/samples/system_policy_v1_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/binaryauthorization/v1/service.proto + +#include "google/cloud/binaryauthorization/system_policy_v1_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::binaryauthorization::SystemPolicyV1Client( + google::cloud::binaryauthorization::MakeSystemPolicyV1Connection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: SystemPolicyV1Client +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/binaryauthorization/samples/validation_helper_v1_client_samples.cc b/google/cloud/binaryauthorization/samples/validation_helper_v1_client_samples.cc new file mode 100644 index 0000000000000..65afc29b325bd --- /dev/null +++ b/google/cloud/binaryauthorization/samples/validation_helper_v1_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/binaryauthorization/v1/service.proto + +#include "google/cloud/binaryauthorization/validation_helper_v1_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::binaryauthorization::ValidationHelperV1Client( + google::cloud::binaryauthorization::MakeValidationHelperV1Connection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ValidationHelperV1Client +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/certificatemanager/samples/certificate_manager_client_samples.cc b/google/cloud/certificatemanager/samples/certificate_manager_client_samples.cc new file mode 100644 index 0000000000000..cf3864d9df3ed --- /dev/null +++ b/google/cloud/certificatemanager/samples/certificate_manager_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/certificatemanager/v1/certificate_manager.proto + +#include "google/cloud/certificatemanager/certificate_manager_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::certificatemanager::CertificateManagerClient( + google::cloud::certificatemanager::MakeCertificateManagerConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CertificateManagerClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/channel/samples/cloud_channel_client_samples.cc b/google/cloud/channel/samples/cloud_channel_client_samples.cc new file mode 100644 index 0000000000000..b68b7b37a6579 --- /dev/null +++ b/google/cloud/channel/samples/cloud_channel_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/channel/v1/service.proto + +#include "google/cloud/channel/cloud_channel_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::channel::CloudChannelServiceClient( + google::cloud::channel::MakeCloudChannelServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CloudChannelServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/cloudbuild/samples/cloud_build_client_samples.cc b/google/cloud/cloudbuild/samples/cloud_build_client_samples.cc new file mode 100644 index 0000000000000..bfdaea8b35104 --- /dev/null +++ b/google/cloud/cloudbuild/samples/cloud_build_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/devtools/cloudbuild/v1/cloudbuild.proto + +#include "google/cloud/cloudbuild/cloud_build_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::cloudbuild::CloudBuildClient( + google::cloud::cloudbuild::MakeCloudBuildConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CloudBuildClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/composer/samples/environments_client_samples.cc b/google/cloud/composer/samples/environments_client_samples.cc new file mode 100644 index 0000000000000..4dae6a0d0f295 --- /dev/null +++ b/google/cloud/composer/samples/environments_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/orchestration/airflow/service/v1/environments.proto + +#include "google/cloud/composer/environments_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::composer::EnvironmentsClient( + google::cloud::composer::MakeEnvironmentsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: EnvironmentsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/composer/samples/image_versions_client_samples.cc b/google/cloud/composer/samples/image_versions_client_samples.cc new file mode 100644 index 0000000000000..1becf9129a798 --- /dev/null +++ b/google/cloud/composer/samples/image_versions_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/orchestration/airflow/service/v1/image_versions.proto + +#include "google/cloud/composer/image_versions_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::composer::ImageVersionsClient( + google::cloud::composer::MakeImageVersionsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ImageVersionsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/contactcenterinsights/samples/contact_center_insights_client_samples.cc b/google/cloud/contactcenterinsights/samples/contact_center_insights_client_samples.cc new file mode 100644 index 0000000000000..4e6de3672ae6f --- /dev/null +++ b/google/cloud/contactcenterinsights/samples/contact_center_insights_client_samples.cc @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/contactcenterinsights/v1/contact_center_insights.proto + +#include "google/cloud/contactcenterinsights/contact_center_insights_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = + google::cloud::contactcenterinsights::ContactCenterInsightsClient( + google::cloud::contactcenterinsights:: + MakeContactCenterInsightsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ContactCenterInsightsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/container/samples/cluster_manager_client_samples.cc b/google/cloud/container/samples/cluster_manager_client_samples.cc new file mode 100644 index 0000000000000..131a443574a9a --- /dev/null +++ b/google/cloud/container/samples/cluster_manager_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/container/v1/cluster_service.proto + +#include "google/cloud/container/cluster_manager_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::container::ClusterManagerClient( + google::cloud::container::MakeClusterManagerConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ClusterManagerClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/containeranalysis/samples/container_analysis_client_samples.cc b/google/cloud/containeranalysis/samples/container_analysis_client_samples.cc new file mode 100644 index 0000000000000..f126419f230e9 --- /dev/null +++ b/google/cloud/containeranalysis/samples/container_analysis_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/devtools/containeranalysis/v1/containeranalysis.proto + +#include "google/cloud/containeranalysis/container_analysis_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::containeranalysis::ContainerAnalysisClient( + google::cloud::containeranalysis::MakeContainerAnalysisConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ContainerAnalysisClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/containeranalysis/samples/grafeas_client_samples.cc b/google/cloud/containeranalysis/samples/grafeas_client_samples.cc new file mode 100644 index 0000000000000..aa3a2e8ca4b83 --- /dev/null +++ b/google/cloud/containeranalysis/samples/grafeas_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: grafeas/v1/grafeas.proto + +#include "google/cloud/containeranalysis/grafeas_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::containeranalysis::GrafeasClient( + google::cloud::containeranalysis::MakeGrafeasConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: GrafeasClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/datacatalog/samples/data_catalog_client_samples.cc b/google/cloud/datacatalog/samples/data_catalog_client_samples.cc new file mode 100644 index 0000000000000..f012b776a6697 --- /dev/null +++ b/google/cloud/datacatalog/samples/data_catalog_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/datacatalog/v1/datacatalog.proto + +#include "google/cloud/datacatalog/data_catalog_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::datacatalog::DataCatalogClient( + google::cloud::datacatalog::MakeDataCatalogConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: DataCatalogClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/datacatalog/samples/policy_tag_manager_client_samples.cc b/google/cloud/datacatalog/samples/policy_tag_manager_client_samples.cc new file mode 100644 index 0000000000000..1a0043c9951b4 --- /dev/null +++ b/google/cloud/datacatalog/samples/policy_tag_manager_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/datacatalog/v1/policytagmanager.proto + +#include "google/cloud/datacatalog/policy_tag_manager_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::datacatalog::PolicyTagManagerClient( + google::cloud::datacatalog::MakePolicyTagManagerConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: PolicyTagManagerClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/datacatalog/samples/policy_tag_manager_serialization_client_samples.cc b/google/cloud/datacatalog/samples/policy_tag_manager_serialization_client_samples.cc new file mode 100644 index 0000000000000..30fd28638697d --- /dev/null +++ b/google/cloud/datacatalog/samples/policy_tag_manager_serialization_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/datacatalog/v1/policytagmanagerserialization.proto + +#include "google/cloud/datacatalog/policy_tag_manager_serialization_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::datacatalog::PolicyTagManagerSerializationClient( + google::cloud::datacatalog::MakePolicyTagManagerSerializationConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: PolicyTagManagerSerializationClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/datamigration/samples/data_migration_client_samples.cc b/google/cloud/datamigration/samples/data_migration_client_samples.cc new file mode 100644 index 0000000000000..a4e9c4995253c --- /dev/null +++ b/google/cloud/datamigration/samples/data_migration_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/clouddms/v1/clouddms.proto + +#include "google/cloud/datamigration/data_migration_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::datamigration::DataMigrationServiceClient( + google::cloud::datamigration::MakeDataMigrationServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: DataMigrationServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dataplex/samples/content_client_samples.cc b/google/cloud/dataplex/samples/content_client_samples.cc new file mode 100644 index 0000000000000..33d3e154eafca --- /dev/null +++ b/google/cloud/dataplex/samples/content_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dataplex/v1/content.proto + +#include "google/cloud/dataplex/content_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dataplex::ContentServiceClient( + google::cloud::dataplex::MakeContentServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ContentServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dataplex/samples/dataplex_client_samples.cc b/google/cloud/dataplex/samples/dataplex_client_samples.cc new file mode 100644 index 0000000000000..03c86d23c0fbe --- /dev/null +++ b/google/cloud/dataplex/samples/dataplex_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dataplex/v1/service.proto + +#include "google/cloud/dataplex/dataplex_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dataplex::DataplexServiceClient( + google::cloud::dataplex::MakeDataplexServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: DataplexServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dataplex/samples/metadata_client_samples.cc b/google/cloud/dataplex/samples/metadata_client_samples.cc new file mode 100644 index 0000000000000..ccfbc065e1f3f --- /dev/null +++ b/google/cloud/dataplex/samples/metadata_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dataplex/v1/metadata.proto + +#include "google/cloud/dataplex/metadata_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dataplex::MetadataServiceClient( + google::cloud::dataplex::MakeMetadataServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: MetadataServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dataproc/samples/autoscaling_policy_client_samples.cc b/google/cloud/dataproc/samples/autoscaling_policy_client_samples.cc new file mode 100644 index 0000000000000..8296922bb92a0 --- /dev/null +++ b/google/cloud/dataproc/samples/autoscaling_policy_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dataproc/v1/autoscaling_policies.proto + +#include "google/cloud/dataproc/autoscaling_policy_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dataproc::AutoscalingPolicyServiceClient( + google::cloud::dataproc::MakeAutoscalingPolicyServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AutoscalingPolicyServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dataproc/samples/batch_controller_client_samples.cc b/google/cloud/dataproc/samples/batch_controller_client_samples.cc new file mode 100644 index 0000000000000..ae95d17aa4cb5 --- /dev/null +++ b/google/cloud/dataproc/samples/batch_controller_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dataproc/v1/batches.proto + +#include "google/cloud/dataproc/batch_controller_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dataproc::BatchControllerClient( + google::cloud::dataproc::MakeBatchControllerConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: BatchControllerClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dataproc/samples/cluster_controller_client_samples.cc b/google/cloud/dataproc/samples/cluster_controller_client_samples.cc new file mode 100644 index 0000000000000..20ac63e0c26f5 --- /dev/null +++ b/google/cloud/dataproc/samples/cluster_controller_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dataproc/v1/clusters.proto + +#include "google/cloud/dataproc/cluster_controller_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dataproc::ClusterControllerClient( + google::cloud::dataproc::MakeClusterControllerConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ClusterControllerClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dataproc/samples/job_controller_client_samples.cc b/google/cloud/dataproc/samples/job_controller_client_samples.cc new file mode 100644 index 0000000000000..4925f7b6774eb --- /dev/null +++ b/google/cloud/dataproc/samples/job_controller_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dataproc/v1/jobs.proto + +#include "google/cloud/dataproc/job_controller_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dataproc::JobControllerClient( + google::cloud::dataproc::MakeJobControllerConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: JobControllerClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dataproc/samples/workflow_template_client_samples.cc b/google/cloud/dataproc/samples/workflow_template_client_samples.cc new file mode 100644 index 0000000000000..f5cb654fdd458 --- /dev/null +++ b/google/cloud/dataproc/samples/workflow_template_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dataproc/v1/workflow_templates.proto + +#include "google/cloud/dataproc/workflow_template_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dataproc::WorkflowTemplateServiceClient( + google::cloud::dataproc::MakeWorkflowTemplateServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: WorkflowTemplateServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/datastream/samples/datastream_client_samples.cc b/google/cloud/datastream/samples/datastream_client_samples.cc new file mode 100644 index 0000000000000..f549e353bc994 --- /dev/null +++ b/google/cloud/datastream/samples/datastream_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/datastream/v1/datastream.proto + +#include "google/cloud/datastream/datastream_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::datastream::DatastreamClient( + google::cloud::datastream::MakeDatastreamConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: DatastreamClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/debugger/samples/controller2_client_samples.cc b/google/cloud/debugger/samples/controller2_client_samples.cc new file mode 100644 index 0000000000000..7640b1eb6f053 --- /dev/null +++ b/google/cloud/debugger/samples/controller2_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/devtools/clouddebugger/v2/controller.proto + +#include "google/cloud/debugger/controller2_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::debugger::Controller2Client( + google::cloud::debugger::MakeController2Connection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: Controller2Client +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/debugger/samples/debugger2_client_samples.cc b/google/cloud/debugger/samples/debugger2_client_samples.cc new file mode 100644 index 0000000000000..adc5becceb6a5 --- /dev/null +++ b/google/cloud/debugger/samples/debugger2_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/devtools/clouddebugger/v2/debugger.proto + +#include "google/cloud/debugger/debugger2_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::debugger::Debugger2Client( + google::cloud::debugger::MakeDebugger2Connection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: Debugger2Client +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/deploy/samples/cloud_deploy_client_samples.cc b/google/cloud/deploy/samples/cloud_deploy_client_samples.cc new file mode 100644 index 0000000000000..e26f2602621de --- /dev/null +++ b/google/cloud/deploy/samples/cloud_deploy_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/deploy/v1/cloud_deploy.proto + +#include "google/cloud/deploy/cloud_deploy_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::deploy::CloudDeployClient( + google::cloud::deploy::MakeCloudDeployConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CloudDeployClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_cx/samples/agents_client_samples.cc b/google/cloud/dialogflow_cx/samples/agents_client_samples.cc new file mode 100644 index 0000000000000..a076bcff4a7db --- /dev/null +++ b/google/cloud/dialogflow_cx/samples/agents_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/cx/v3/agent.proto + +#include "google/cloud/dialogflow_cx/agents_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_cx::AgentsClient( + google::cloud::dialogflow_cx::MakeAgentsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AgentsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_cx/samples/changelogs_client_samples.cc b/google/cloud/dialogflow_cx/samples/changelogs_client_samples.cc new file mode 100644 index 0000000000000..9f71308e92b40 --- /dev/null +++ b/google/cloud/dialogflow_cx/samples/changelogs_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/cx/v3/changelog.proto + +#include "google/cloud/dialogflow_cx/changelogs_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_cx::ChangelogsClient( + google::cloud::dialogflow_cx::MakeChangelogsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ChangelogsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_cx/samples/deployments_client_samples.cc b/google/cloud/dialogflow_cx/samples/deployments_client_samples.cc new file mode 100644 index 0000000000000..4e453058483af --- /dev/null +++ b/google/cloud/dialogflow_cx/samples/deployments_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/cx/v3/deployment.proto + +#include "google/cloud/dialogflow_cx/deployments_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_cx::DeploymentsClient( + google::cloud::dialogflow_cx::MakeDeploymentsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: DeploymentsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_cx/samples/entity_types_client_samples.cc b/google/cloud/dialogflow_cx/samples/entity_types_client_samples.cc new file mode 100644 index 0000000000000..d2641e58a32f8 --- /dev/null +++ b/google/cloud/dialogflow_cx/samples/entity_types_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/cx/v3/entity_type.proto + +#include "google/cloud/dialogflow_cx/entity_types_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_cx::EntityTypesClient( + google::cloud::dialogflow_cx::MakeEntityTypesConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: EntityTypesClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_cx/samples/environments_client_samples.cc b/google/cloud/dialogflow_cx/samples/environments_client_samples.cc new file mode 100644 index 0000000000000..e2c8c98de4031 --- /dev/null +++ b/google/cloud/dialogflow_cx/samples/environments_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/cx/v3/environment.proto + +#include "google/cloud/dialogflow_cx/environments_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_cx::EnvironmentsClient( + google::cloud::dialogflow_cx::MakeEnvironmentsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: EnvironmentsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_cx/samples/experiments_client_samples.cc b/google/cloud/dialogflow_cx/samples/experiments_client_samples.cc new file mode 100644 index 0000000000000..ec5ef0943ff93 --- /dev/null +++ b/google/cloud/dialogflow_cx/samples/experiments_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/cx/v3/experiment.proto + +#include "google/cloud/dialogflow_cx/experiments_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_cx::ExperimentsClient( + google::cloud::dialogflow_cx::MakeExperimentsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ExperimentsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_cx/samples/flows_client_samples.cc b/google/cloud/dialogflow_cx/samples/flows_client_samples.cc new file mode 100644 index 0000000000000..c950a3691f471 --- /dev/null +++ b/google/cloud/dialogflow_cx/samples/flows_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/cx/v3/flow.proto + +#include "google/cloud/dialogflow_cx/flows_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_cx::FlowsClient( + google::cloud::dialogflow_cx::MakeFlowsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: FlowsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_cx/samples/intents_client_samples.cc b/google/cloud/dialogflow_cx/samples/intents_client_samples.cc new file mode 100644 index 0000000000000..22033591ca016 --- /dev/null +++ b/google/cloud/dialogflow_cx/samples/intents_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/cx/v3/intent.proto + +#include "google/cloud/dialogflow_cx/intents_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_cx::IntentsClient( + google::cloud::dialogflow_cx::MakeIntentsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: IntentsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_cx/samples/pages_client_samples.cc b/google/cloud/dialogflow_cx/samples/pages_client_samples.cc new file mode 100644 index 0000000000000..61269006569c7 --- /dev/null +++ b/google/cloud/dialogflow_cx/samples/pages_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/cx/v3/page.proto + +#include "google/cloud/dialogflow_cx/pages_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_cx::PagesClient( + google::cloud::dialogflow_cx::MakePagesConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: PagesClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_cx/samples/security_settings_client_samples.cc b/google/cloud/dialogflow_cx/samples/security_settings_client_samples.cc new file mode 100644 index 0000000000000..c1b6c8b1c3707 --- /dev/null +++ b/google/cloud/dialogflow_cx/samples/security_settings_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/cx/v3/security_settings.proto + +#include "google/cloud/dialogflow_cx/security_settings_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_cx::SecuritySettingsServiceClient( + google::cloud::dialogflow_cx::MakeSecuritySettingsServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: SecuritySettingsServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_cx/samples/session_entity_types_client_samples.cc b/google/cloud/dialogflow_cx/samples/session_entity_types_client_samples.cc new file mode 100644 index 0000000000000..2ec212d21665e --- /dev/null +++ b/google/cloud/dialogflow_cx/samples/session_entity_types_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/cx/v3/session_entity_type.proto + +#include "google/cloud/dialogflow_cx/session_entity_types_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_cx::SessionEntityTypesClient( + google::cloud::dialogflow_cx::MakeSessionEntityTypesConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: SessionEntityTypesClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_cx/samples/sessions_client_samples.cc b/google/cloud/dialogflow_cx/samples/sessions_client_samples.cc new file mode 100644 index 0000000000000..ed67b418f2dec --- /dev/null +++ b/google/cloud/dialogflow_cx/samples/sessions_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/cx/v3/session.proto + +#include "google/cloud/dialogflow_cx/sessions_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_cx::SessionsClient( + google::cloud::dialogflow_cx::MakeSessionsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: SessionsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_cx/samples/test_cases_client_samples.cc b/google/cloud/dialogflow_cx/samples/test_cases_client_samples.cc new file mode 100644 index 0000000000000..11ef37c07a01c --- /dev/null +++ b/google/cloud/dialogflow_cx/samples/test_cases_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/cx/v3/test_case.proto + +#include "google/cloud/dialogflow_cx/test_cases_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_cx::TestCasesClient( + google::cloud::dialogflow_cx::MakeTestCasesConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: TestCasesClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_cx/samples/transition_route_groups_client_samples.cc b/google/cloud/dialogflow_cx/samples/transition_route_groups_client_samples.cc new file mode 100644 index 0000000000000..c81cec180ad45 --- /dev/null +++ b/google/cloud/dialogflow_cx/samples/transition_route_groups_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/cx/v3/transition_route_group.proto + +#include "google/cloud/dialogflow_cx/transition_route_groups_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_cx::TransitionRouteGroupsClient( + google::cloud::dialogflow_cx::MakeTransitionRouteGroupsConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: TransitionRouteGroupsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_cx/samples/versions_client_samples.cc b/google/cloud/dialogflow_cx/samples/versions_client_samples.cc new file mode 100644 index 0000000000000..15fee72e884c7 --- /dev/null +++ b/google/cloud/dialogflow_cx/samples/versions_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/cx/v3/version.proto + +#include "google/cloud/dialogflow_cx/versions_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_cx::VersionsClient( + google::cloud::dialogflow_cx::MakeVersionsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: VersionsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_cx/samples/webhooks_client_samples.cc b/google/cloud/dialogflow_cx/samples/webhooks_client_samples.cc new file mode 100644 index 0000000000000..e7e17ae9fafac --- /dev/null +++ b/google/cloud/dialogflow_cx/samples/webhooks_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/cx/v3/webhook.proto + +#include "google/cloud/dialogflow_cx/webhooks_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_cx::WebhooksClient( + google::cloud::dialogflow_cx::MakeWebhooksConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: WebhooksClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_es/samples/agents_client_samples.cc b/google/cloud/dialogflow_es/samples/agents_client_samples.cc new file mode 100644 index 0000000000000..ba0485add368c --- /dev/null +++ b/google/cloud/dialogflow_es/samples/agents_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/v2/agent.proto + +#include "google/cloud/dialogflow_es/agents_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_es::AgentsClient( + google::cloud::dialogflow_es::MakeAgentsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AgentsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_es/samples/answer_records_client_samples.cc b/google/cloud/dialogflow_es/samples/answer_records_client_samples.cc new file mode 100644 index 0000000000000..5736c49c69ff6 --- /dev/null +++ b/google/cloud/dialogflow_es/samples/answer_records_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/v2/answer_record.proto + +#include "google/cloud/dialogflow_es/answer_records_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_es::AnswerRecordsClient( + google::cloud::dialogflow_es::MakeAnswerRecordsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AnswerRecordsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_es/samples/contexts_client_samples.cc b/google/cloud/dialogflow_es/samples/contexts_client_samples.cc new file mode 100644 index 0000000000000..1d1d79f984851 --- /dev/null +++ b/google/cloud/dialogflow_es/samples/contexts_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/v2/context.proto + +#include "google/cloud/dialogflow_es/contexts_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_es::ContextsClient( + google::cloud::dialogflow_es::MakeContextsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ContextsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_es/samples/conversation_datasets_client_samples.cc b/google/cloud/dialogflow_es/samples/conversation_datasets_client_samples.cc new file mode 100644 index 0000000000000..6140db70a29f2 --- /dev/null +++ b/google/cloud/dialogflow_es/samples/conversation_datasets_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/v2/conversation_dataset.proto + +#include "google/cloud/dialogflow_es/conversation_datasets_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_es::ConversationDatasetsClient( + google::cloud::dialogflow_es::MakeConversationDatasetsConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ConversationDatasetsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_es/samples/conversation_models_client_samples.cc b/google/cloud/dialogflow_es/samples/conversation_models_client_samples.cc new file mode 100644 index 0000000000000..0fdf2afededad --- /dev/null +++ b/google/cloud/dialogflow_es/samples/conversation_models_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/v2/conversation_model.proto + +#include "google/cloud/dialogflow_es/conversation_models_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_es::ConversationModelsClient( + google::cloud::dialogflow_es::MakeConversationModelsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ConversationModelsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_es/samples/conversation_profiles_client_samples.cc b/google/cloud/dialogflow_es/samples/conversation_profiles_client_samples.cc new file mode 100644 index 0000000000000..d8e4a0e03b029 --- /dev/null +++ b/google/cloud/dialogflow_es/samples/conversation_profiles_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/v2/conversation_profile.proto + +#include "google/cloud/dialogflow_es/conversation_profiles_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_es::ConversationProfilesClient( + google::cloud::dialogflow_es::MakeConversationProfilesConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ConversationProfilesClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_es/samples/conversations_client_samples.cc b/google/cloud/dialogflow_es/samples/conversations_client_samples.cc new file mode 100644 index 0000000000000..e8161a0a3218a --- /dev/null +++ b/google/cloud/dialogflow_es/samples/conversations_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/v2/conversation.proto + +#include "google/cloud/dialogflow_es/conversations_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_es::ConversationsClient( + google::cloud::dialogflow_es::MakeConversationsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ConversationsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_es/samples/documents_client_samples.cc b/google/cloud/dialogflow_es/samples/documents_client_samples.cc new file mode 100644 index 0000000000000..2354021eeb348 --- /dev/null +++ b/google/cloud/dialogflow_es/samples/documents_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/v2/document.proto + +#include "google/cloud/dialogflow_es/documents_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_es::DocumentsClient( + google::cloud::dialogflow_es::MakeDocumentsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: DocumentsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_es/samples/entity_types_client_samples.cc b/google/cloud/dialogflow_es/samples/entity_types_client_samples.cc new file mode 100644 index 0000000000000..5de29273715fb --- /dev/null +++ b/google/cloud/dialogflow_es/samples/entity_types_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/v2/entity_type.proto + +#include "google/cloud/dialogflow_es/entity_types_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_es::EntityTypesClient( + google::cloud::dialogflow_es::MakeEntityTypesConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: EntityTypesClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_es/samples/environments_client_samples.cc b/google/cloud/dialogflow_es/samples/environments_client_samples.cc new file mode 100644 index 0000000000000..389f06e20192c --- /dev/null +++ b/google/cloud/dialogflow_es/samples/environments_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/v2/environment.proto + +#include "google/cloud/dialogflow_es/environments_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_es::EnvironmentsClient( + google::cloud::dialogflow_es::MakeEnvironmentsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: EnvironmentsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_es/samples/fulfillments_client_samples.cc b/google/cloud/dialogflow_es/samples/fulfillments_client_samples.cc new file mode 100644 index 0000000000000..c45a470abfeea --- /dev/null +++ b/google/cloud/dialogflow_es/samples/fulfillments_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/v2/fulfillment.proto + +#include "google/cloud/dialogflow_es/fulfillments_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_es::FulfillmentsClient( + google::cloud::dialogflow_es::MakeFulfillmentsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: FulfillmentsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_es/samples/intents_client_samples.cc b/google/cloud/dialogflow_es/samples/intents_client_samples.cc new file mode 100644 index 0000000000000..9198358ab12f8 --- /dev/null +++ b/google/cloud/dialogflow_es/samples/intents_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/v2/intent.proto + +#include "google/cloud/dialogflow_es/intents_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_es::IntentsClient( + google::cloud::dialogflow_es::MakeIntentsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: IntentsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_es/samples/knowledge_bases_client_samples.cc b/google/cloud/dialogflow_es/samples/knowledge_bases_client_samples.cc new file mode 100644 index 0000000000000..1ec6aa8e40405 --- /dev/null +++ b/google/cloud/dialogflow_es/samples/knowledge_bases_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/v2/knowledge_base.proto + +#include "google/cloud/dialogflow_es/knowledge_bases_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_es::KnowledgeBasesClient( + google::cloud::dialogflow_es::MakeKnowledgeBasesConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: KnowledgeBasesClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_es/samples/participants_client_samples.cc b/google/cloud/dialogflow_es/samples/participants_client_samples.cc new file mode 100644 index 0000000000000..9daa5fafe9bd5 --- /dev/null +++ b/google/cloud/dialogflow_es/samples/participants_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/v2/participant.proto + +#include "google/cloud/dialogflow_es/participants_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_es::ParticipantsClient( + google::cloud::dialogflow_es::MakeParticipantsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ParticipantsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_es/samples/session_entity_types_client_samples.cc b/google/cloud/dialogflow_es/samples/session_entity_types_client_samples.cc new file mode 100644 index 0000000000000..b0aa912e5e7e9 --- /dev/null +++ b/google/cloud/dialogflow_es/samples/session_entity_types_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/v2/session_entity_type.proto + +#include "google/cloud/dialogflow_es/session_entity_types_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_es::SessionEntityTypesClient( + google::cloud::dialogflow_es::MakeSessionEntityTypesConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: SessionEntityTypesClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_es/samples/sessions_client_samples.cc b/google/cloud/dialogflow_es/samples/sessions_client_samples.cc new file mode 100644 index 0000000000000..9edc649079e5b --- /dev/null +++ b/google/cloud/dialogflow_es/samples/sessions_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/v2/session.proto + +#include "google/cloud/dialogflow_es/sessions_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_es::SessionsClient( + google::cloud::dialogflow_es::MakeSessionsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: SessionsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dialogflow_es/samples/versions_client_samples.cc b/google/cloud/dialogflow_es/samples/versions_client_samples.cc new file mode 100644 index 0000000000000..375f439850d86 --- /dev/null +++ b/google/cloud/dialogflow_es/samples/versions_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/dialogflow/v2/version.proto + +#include "google/cloud/dialogflow_es/versions_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dialogflow_es::VersionsClient( + google::cloud::dialogflow_es::MakeVersionsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: VersionsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dlp/samples/dlp_client_samples.cc b/google/cloud/dlp/samples/dlp_client_samples.cc new file mode 100644 index 0000000000000..8603b74cd567f --- /dev/null +++ b/google/cloud/dlp/samples/dlp_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/privacy/dlp/v2/dlp.proto + +#include "google/cloud/dlp/dlp_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::dlp::DlpServiceClient( + google::cloud::dlp::MakeDlpServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: DlpServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/documentai/samples/document_processor_client_samples.cc b/google/cloud/documentai/samples/document_processor_client_samples.cc new file mode 100644 index 0000000000000..db357601d4eaf --- /dev/null +++ b/google/cloud/documentai/samples/document_processor_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/documentai/v1/document_processor_service.proto + +#include "google/cloud/documentai/document_processor_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::documentai::DocumentProcessorServiceClient( + google::cloud::documentai::MakeDocumentProcessorServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: DocumentProcessorServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/edgecontainer/samples/edge_container_client_samples.cc b/google/cloud/edgecontainer/samples/edge_container_client_samples.cc new file mode 100644 index 0000000000000..a45044dce5b87 --- /dev/null +++ b/google/cloud/edgecontainer/samples/edge_container_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/edgecontainer/v1/service.proto + +#include "google/cloud/edgecontainer/edge_container_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::edgecontainer::EdgeContainerClient( + google::cloud::edgecontainer::MakeEdgeContainerConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: EdgeContainerClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/eventarc/samples/eventarc_client_samples.cc b/google/cloud/eventarc/samples/eventarc_client_samples.cc new file mode 100644 index 0000000000000..688d9be552d75 --- /dev/null +++ b/google/cloud/eventarc/samples/eventarc_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/eventarc/v1/eventarc.proto + +#include "google/cloud/eventarc/eventarc_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::eventarc::EventarcClient( + google::cloud::eventarc::MakeEventarcConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: EventarcClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/eventarc/samples/publisher_client_samples.cc b/google/cloud/eventarc/samples/publisher_client_samples.cc new file mode 100644 index 0000000000000..c3e7d10c1e199 --- /dev/null +++ b/google/cloud/eventarc/samples/publisher_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/eventarc/publishing/v1/publisher.proto + +#include "google/cloud/eventarc/publisher_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::eventarc::PublisherClient( + google::cloud::eventarc::MakePublisherConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: PublisherClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/filestore/samples/cloud_filestore_manager_client_samples.cc b/google/cloud/filestore/samples/cloud_filestore_manager_client_samples.cc new file mode 100644 index 0000000000000..ed22fb1a9d0a1 --- /dev/null +++ b/google/cloud/filestore/samples/cloud_filestore_manager_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/filestore/v1/cloud_filestore_service.proto + +#include "google/cloud/filestore/cloud_filestore_manager_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::filestore::CloudFilestoreManagerClient( + google::cloud::filestore::MakeCloudFilestoreManagerConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CloudFilestoreManagerClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/functions/samples/cloud_functions_client_samples.cc b/google/cloud/functions/samples/cloud_functions_client_samples.cc new file mode 100644 index 0000000000000..aab6502e897ad --- /dev/null +++ b/google/cloud/functions/samples/cloud_functions_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/functions/v1/functions.proto + +#include "google/cloud/functions/cloud_functions_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::functions::CloudFunctionsServiceClient( + google::cloud::functions::MakeCloudFunctionsServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CloudFunctionsServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/gameservices/samples/game_server_clusters_client_samples.cc b/google/cloud/gameservices/samples/game_server_clusters_client_samples.cc new file mode 100644 index 0000000000000..a1c69e24f2b01 --- /dev/null +++ b/google/cloud/gameservices/samples/game_server_clusters_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/gaming/v1/game_server_clusters_service.proto + +#include "google/cloud/gameservices/game_server_clusters_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::gameservices::GameServerClustersServiceClient( + google::cloud::gameservices::MakeGameServerClustersServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: GameServerClustersServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/gameservices/samples/game_server_configs_client_samples.cc b/google/cloud/gameservices/samples/game_server_configs_client_samples.cc new file mode 100644 index 0000000000000..5b51f95b980d8 --- /dev/null +++ b/google/cloud/gameservices/samples/game_server_configs_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/gaming/v1/game_server_configs_service.proto + +#include "google/cloud/gameservices/game_server_configs_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::gameservices::GameServerConfigsServiceClient( + google::cloud::gameservices::MakeGameServerConfigsServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: GameServerConfigsServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/gameservices/samples/game_server_deployments_client_samples.cc b/google/cloud/gameservices/samples/game_server_deployments_client_samples.cc new file mode 100644 index 0000000000000..81f16f2fa6bcf --- /dev/null +++ b/google/cloud/gameservices/samples/game_server_deployments_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/gaming/v1/game_server_deployments_service.proto + +#include "google/cloud/gameservices/game_server_deployments_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::gameservices::GameServerDeploymentsServiceClient( + google::cloud::gameservices::MakeGameServerDeploymentsServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: GameServerDeploymentsServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/gameservices/samples/realms_client_samples.cc b/google/cloud/gameservices/samples/realms_client_samples.cc new file mode 100644 index 0000000000000..1cbf62d316de5 --- /dev/null +++ b/google/cloud/gameservices/samples/realms_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/gaming/v1/realms_service.proto + +#include "google/cloud/gameservices/realms_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::gameservices::RealmsServiceClient( + google::cloud::gameservices::MakeRealmsServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: RealmsServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/gkehub/samples/gke_hub_client_samples.cc b/google/cloud/gkehub/samples/gke_hub_client_samples.cc new file mode 100644 index 0000000000000..82021086af0b9 --- /dev/null +++ b/google/cloud/gkehub/samples/gke_hub_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/gkehub/v1/service.proto + +#include "google/cloud/gkehub/gke_hub_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::gkehub::GkeHubClient( + google::cloud::gkehub::MakeGkeHubConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: GkeHubClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/iam/samples/iam_client_samples.cc b/google/cloud/iam/samples/iam_client_samples.cc new file mode 100644 index 0000000000000..e4c3cb0cbf0ba --- /dev/null +++ b/google/cloud/iam/samples/iam_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/iam/admin/v1/iam.proto + +#include "google/cloud/iam/iam_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::iam::IAMClient( + google::cloud::iam::MakeIAMConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: IAMClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/iam/samples/iam_credentials_client_samples.cc b/google/cloud/iam/samples/iam_credentials_client_samples.cc new file mode 100644 index 0000000000000..a0076a848d1db --- /dev/null +++ b/google/cloud/iam/samples/iam_credentials_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/iam/credentials/v1/iamcredentials.proto + +#include "google/cloud/iam/iam_credentials_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::iam::IAMCredentialsClient( + google::cloud::iam::MakeIAMCredentialsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: IAMCredentialsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/iam/samples/iam_policy_client_samples.cc b/google/cloud/iam/samples/iam_policy_client_samples.cc new file mode 100644 index 0000000000000..6c7667ebb4019 --- /dev/null +++ b/google/cloud/iam/samples/iam_policy_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/iam/v1/iam_policy.proto + +#include "google/cloud/iam/iam_policy_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::iam::IAMPolicyClient( + google::cloud::iam::MakeIAMPolicyConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: IAMPolicyClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/iap/samples/identity_aware_proxy_admin_client_samples.cc b/google/cloud/iap/samples/identity_aware_proxy_admin_client_samples.cc new file mode 100644 index 0000000000000..93b668d3def0f --- /dev/null +++ b/google/cloud/iap/samples/identity_aware_proxy_admin_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/iap/v1/service.proto + +#include "google/cloud/iap/identity_aware_proxy_admin_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::iap::IdentityAwareProxyAdminServiceClient( + google::cloud::iap::MakeIdentityAwareProxyAdminServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: IdentityAwareProxyAdminServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/iap/samples/identity_aware_proxy_o_auth_client_samples.cc b/google/cloud/iap/samples/identity_aware_proxy_o_auth_client_samples.cc new file mode 100644 index 0000000000000..aec7b8c01a19d --- /dev/null +++ b/google/cloud/iap/samples/identity_aware_proxy_o_auth_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/iap/v1/service.proto + +#include "google/cloud/iap/identity_aware_proxy_o_auth_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::iap::IdentityAwareProxyOAuthServiceClient( + google::cloud::iap::MakeIdentityAwareProxyOAuthServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: IdentityAwareProxyOAuthServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/ids/samples/ids_client_samples.cc b/google/cloud/ids/samples/ids_client_samples.cc new file mode 100644 index 0000000000000..a9cc8808745d6 --- /dev/null +++ b/google/cloud/ids/samples/ids_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/ids/v1/ids.proto + +#include "google/cloud/ids/ids_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::ids::IDSClient( + google::cloud::ids::MakeIDSConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: IDSClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/iot/samples/device_manager_client_samples.cc b/google/cloud/iot/samples/device_manager_client_samples.cc new file mode 100644 index 0000000000000..7b945ee9761fe --- /dev/null +++ b/google/cloud/iot/samples/device_manager_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/iot/v1/device_manager.proto + +#include "google/cloud/iot/device_manager_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::iot::DeviceManagerClient( + google::cloud::iot::MakeDeviceManagerConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: DeviceManagerClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/kms/samples/ekm_client_samples.cc b/google/cloud/kms/samples/ekm_client_samples.cc new file mode 100644 index 0000000000000..3583110699b5d --- /dev/null +++ b/google/cloud/kms/samples/ekm_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/kms/v1/ekm_service.proto + +#include "google/cloud/kms/ekm_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::kms::EkmServiceClient( + google::cloud::kms::MakeEkmServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: EkmServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/kms/samples/key_management_client_samples.cc b/google/cloud/kms/samples/key_management_client_samples.cc new file mode 100644 index 0000000000000..6a02e80745cfe --- /dev/null +++ b/google/cloud/kms/samples/key_management_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/kms/v1/service.proto + +#include "google/cloud/kms/key_management_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::kms::KeyManagementServiceClient( + google::cloud::kms::MakeKeyManagementServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: KeyManagementServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/language/samples/language_client_samples.cc b/google/cloud/language/samples/language_client_samples.cc new file mode 100644 index 0000000000000..1f407aa032611 --- /dev/null +++ b/google/cloud/language/samples/language_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/language/v1/language_service.proto + +#include "google/cloud/language/language_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::language::LanguageServiceClient( + google::cloud::language::MakeLanguageServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: LanguageServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/logging/samples/logging_service_v2_client_samples.cc b/google/cloud/logging/samples/logging_service_v2_client_samples.cc new file mode 100644 index 0000000000000..3bd0869c08bdd --- /dev/null +++ b/google/cloud/logging/samples/logging_service_v2_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/logging/v2/logging.proto + +#include "google/cloud/logging/logging_service_v2_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::logging::LoggingServiceV2Client( + google::cloud::logging::MakeLoggingServiceV2Connection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: LoggingServiceV2Client +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/managedidentities/samples/managed_identities_client_samples.cc b/google/cloud/managedidentities/samples/managed_identities_client_samples.cc new file mode 100644 index 0000000000000..ff20da01cec25 --- /dev/null +++ b/google/cloud/managedidentities/samples/managed_identities_client_samples.cc @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/managedidentities/v1/managed_identities_service.proto + +#include "google/cloud/managedidentities/managed_identities_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = + google::cloud::managedidentities::ManagedIdentitiesServiceClient( + google::cloud::managedidentities:: + MakeManagedIdentitiesServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ManagedIdentitiesServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/memcache/samples/cloud_memcache_client_samples.cc b/google/cloud/memcache/samples/cloud_memcache_client_samples.cc new file mode 100644 index 0000000000000..b242fd2d927e2 --- /dev/null +++ b/google/cloud/memcache/samples/cloud_memcache_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/memcache/v1/cloud_memcache.proto + +#include "google/cloud/memcache/cloud_memcache_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::memcache::CloudMemcacheClient( + google::cloud::memcache::MakeCloudMemcacheConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CloudMemcacheClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/monitoring/samples/alert_policy_client_samples.cc b/google/cloud/monitoring/samples/alert_policy_client_samples.cc new file mode 100644 index 0000000000000..fa13049614afb --- /dev/null +++ b/google/cloud/monitoring/samples/alert_policy_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/monitoring/v3/alert_service.proto + +#include "google/cloud/monitoring/alert_policy_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::monitoring::AlertPolicyServiceClient( + google::cloud::monitoring::MakeAlertPolicyServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AlertPolicyServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/monitoring/samples/dashboards_client_samples.cc b/google/cloud/monitoring/samples/dashboards_client_samples.cc new file mode 100644 index 0000000000000..b2e3a475a1cc4 --- /dev/null +++ b/google/cloud/monitoring/samples/dashboards_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/monitoring/dashboard/v1/dashboards_service.proto + +#include "google/cloud/monitoring/dashboards_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::monitoring::DashboardsServiceClient( + google::cloud::monitoring::MakeDashboardsServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: DashboardsServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/monitoring/samples/group_client_samples.cc b/google/cloud/monitoring/samples/group_client_samples.cc new file mode 100644 index 0000000000000..30adda00e64db --- /dev/null +++ b/google/cloud/monitoring/samples/group_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/monitoring/v3/group_service.proto + +#include "google/cloud/monitoring/group_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::monitoring::GroupServiceClient( + google::cloud::monitoring::MakeGroupServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: GroupServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/monitoring/samples/metric_client_samples.cc b/google/cloud/monitoring/samples/metric_client_samples.cc new file mode 100644 index 0000000000000..2a807d5f80d42 --- /dev/null +++ b/google/cloud/monitoring/samples/metric_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/monitoring/v3/metric_service.proto + +#include "google/cloud/monitoring/metric_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::monitoring::MetricServiceClient( + google::cloud::monitoring::MakeMetricServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: MetricServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/monitoring/samples/metrics_scopes_client_samples.cc b/google/cloud/monitoring/samples/metrics_scopes_client_samples.cc new file mode 100644 index 0000000000000..eb13eac9cc7fd --- /dev/null +++ b/google/cloud/monitoring/samples/metrics_scopes_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/monitoring/metricsscope/v1/metrics_scopes.proto + +#include "google/cloud/monitoring/metrics_scopes_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::monitoring::MetricsScopesClient( + google::cloud::monitoring::MakeMetricsScopesConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: MetricsScopesClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/monitoring/samples/notification_channel_client_samples.cc b/google/cloud/monitoring/samples/notification_channel_client_samples.cc new file mode 100644 index 0000000000000..d5a27898d8f4e --- /dev/null +++ b/google/cloud/monitoring/samples/notification_channel_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/monitoring/v3/notification_service.proto + +#include "google/cloud/monitoring/notification_channel_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::monitoring::NotificationChannelServiceClient( + google::cloud::monitoring::MakeNotificationChannelServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: NotificationChannelServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/monitoring/samples/query_client_samples.cc b/google/cloud/monitoring/samples/query_client_samples.cc new file mode 100644 index 0000000000000..00070e51669e5 --- /dev/null +++ b/google/cloud/monitoring/samples/query_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/monitoring/v3/query_service.proto + +#include "google/cloud/monitoring/query_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::monitoring::QueryServiceClient( + google::cloud::monitoring::MakeQueryServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: QueryServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/monitoring/samples/service_monitoring_client_samples.cc b/google/cloud/monitoring/samples/service_monitoring_client_samples.cc new file mode 100644 index 0000000000000..f843e62e08946 --- /dev/null +++ b/google/cloud/monitoring/samples/service_monitoring_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/monitoring/v3/service_service.proto + +#include "google/cloud/monitoring/service_monitoring_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::monitoring::ServiceMonitoringServiceClient( + google::cloud::monitoring::MakeServiceMonitoringServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ServiceMonitoringServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/monitoring/samples/uptime_check_client_samples.cc b/google/cloud/monitoring/samples/uptime_check_client_samples.cc new file mode 100644 index 0000000000000..384132f69ced3 --- /dev/null +++ b/google/cloud/monitoring/samples/uptime_check_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/monitoring/v3/uptime_service.proto + +#include "google/cloud/monitoring/uptime_check_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::monitoring::UptimeCheckServiceClient( + google::cloud::monitoring::MakeUptimeCheckServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: UptimeCheckServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/networkconnectivity/samples/hub_client_samples.cc b/google/cloud/networkconnectivity/samples/hub_client_samples.cc new file mode 100644 index 0000000000000..b583268e4f000 --- /dev/null +++ b/google/cloud/networkconnectivity/samples/hub_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/networkconnectivity/v1/hub.proto + +#include "google/cloud/networkconnectivity/hub_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::networkconnectivity::HubServiceClient( + google::cloud::networkconnectivity::MakeHubServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: HubServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/networkmanagement/samples/reachability_client_samples.cc b/google/cloud/networkmanagement/samples/reachability_client_samples.cc new file mode 100644 index 0000000000000..bbb2310ff60f4 --- /dev/null +++ b/google/cloud/networkmanagement/samples/reachability_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/networkmanagement/v1/reachability.proto + +#include "google/cloud/networkmanagement/reachability_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::networkmanagement::ReachabilityServiceClient( + google::cloud::networkmanagement::MakeReachabilityServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ReachabilityServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/notebooks/samples/managed_notebook_client_samples.cc b/google/cloud/notebooks/samples/managed_notebook_client_samples.cc new file mode 100644 index 0000000000000..96e58e8b4552a --- /dev/null +++ b/google/cloud/notebooks/samples/managed_notebook_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/notebooks/v1/managed_service.proto + +#include "google/cloud/notebooks/managed_notebook_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::notebooks::ManagedNotebookServiceClient( + google::cloud::notebooks::MakeManagedNotebookServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ManagedNotebookServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/notebooks/samples/notebook_client_samples.cc b/google/cloud/notebooks/samples/notebook_client_samples.cc new file mode 100644 index 0000000000000..2ed3efc1822cb --- /dev/null +++ b/google/cloud/notebooks/samples/notebook_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/notebooks/v1/service.proto + +#include "google/cloud/notebooks/notebook_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::notebooks::NotebookServiceClient( + google::cloud::notebooks::MakeNotebookServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: NotebookServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/optimization/samples/fleet_routing_client_samples.cc b/google/cloud/optimization/samples/fleet_routing_client_samples.cc new file mode 100644 index 0000000000000..1944823010ca9 --- /dev/null +++ b/google/cloud/optimization/samples/fleet_routing_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/optimization/v1/fleet_routing.proto + +#include "google/cloud/optimization/fleet_routing_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::optimization::FleetRoutingClient( + google::cloud::optimization::MakeFleetRoutingConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: FleetRoutingClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/orgpolicy/samples/org_policy_client_samples.cc b/google/cloud/orgpolicy/samples/org_policy_client_samples.cc new file mode 100644 index 0000000000000..81b14241100c4 --- /dev/null +++ b/google/cloud/orgpolicy/samples/org_policy_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/orgpolicy/v2/orgpolicy.proto + +#include "google/cloud/orgpolicy/org_policy_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::orgpolicy::OrgPolicyClient( + google::cloud::orgpolicy::MakeOrgPolicyConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: OrgPolicyClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/osconfig/samples/agent_endpoint_client_samples.cc b/google/cloud/osconfig/samples/agent_endpoint_client_samples.cc new file mode 100644 index 0000000000000..93d364e79611f --- /dev/null +++ b/google/cloud/osconfig/samples/agent_endpoint_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/osconfig/agentendpoint/v1/agentendpoint.proto + +#include "google/cloud/osconfig/agent_endpoint_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::osconfig::AgentEndpointServiceClient( + google::cloud::osconfig::MakeAgentEndpointServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AgentEndpointServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/osconfig/samples/os_config_client_samples.cc b/google/cloud/osconfig/samples/os_config_client_samples.cc new file mode 100644 index 0000000000000..68cb1baa06640 --- /dev/null +++ b/google/cloud/osconfig/samples/os_config_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/osconfig/v1/osconfig_service.proto + +#include "google/cloud/osconfig/os_config_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::osconfig::OsConfigServiceClient( + google::cloud::osconfig::MakeOsConfigServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: OsConfigServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/oslogin/samples/os_login_client_samples.cc b/google/cloud/oslogin/samples/os_login_client_samples.cc new file mode 100644 index 0000000000000..da4e6b5b68ee4 --- /dev/null +++ b/google/cloud/oslogin/samples/os_login_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/oslogin/v1/oslogin.proto + +#include "google/cloud/oslogin/os_login_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::oslogin::OsLoginServiceClient( + google::cloud::oslogin::MakeOsLoginServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: OsLoginServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/policytroubleshooter/samples/iam_checker_client_samples.cc b/google/cloud/policytroubleshooter/samples/iam_checker_client_samples.cc new file mode 100644 index 0000000000000..aec23469de31e --- /dev/null +++ b/google/cloud/policytroubleshooter/samples/iam_checker_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/policytroubleshooter/v1/checker.proto + +#include "google/cloud/policytroubleshooter/iam_checker_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::policytroubleshooter::IamCheckerClient( + google::cloud::policytroubleshooter::MakeIamCheckerConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: IamCheckerClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/privateca/samples/certificate_authority_client_samples.cc b/google/cloud/privateca/samples/certificate_authority_client_samples.cc new file mode 100644 index 0000000000000..59b41e27087c3 --- /dev/null +++ b/google/cloud/privateca/samples/certificate_authority_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/security/privateca/v1/service.proto + +#include "google/cloud/privateca/certificate_authority_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::privateca::CertificateAuthorityServiceClient( + google::cloud::privateca::MakeCertificateAuthorityServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CertificateAuthorityServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/profiler/samples/profiler_client_samples.cc b/google/cloud/profiler/samples/profiler_client_samples.cc new file mode 100644 index 0000000000000..9c131d96b0b58 --- /dev/null +++ b/google/cloud/profiler/samples/profiler_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/devtools/cloudprofiler/v2/profiler.proto + +#include "google/cloud/profiler/profiler_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::profiler::ProfilerServiceClient( + google::cloud::profiler::MakeProfilerServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ProfilerServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/pubsublite/samples/admin_client_samples.cc b/google/cloud/pubsublite/samples/admin_client_samples.cc new file mode 100644 index 0000000000000..72ccf7a419d50 --- /dev/null +++ b/google/cloud/pubsublite/samples/admin_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/pubsublite/v1/admin.proto + +#include "google/cloud/pubsublite/admin_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::pubsublite::AdminServiceClient( + google::cloud::pubsublite::MakeAdminServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: AdminServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/pubsublite/samples/topic_stats_client_samples.cc b/google/cloud/pubsublite/samples/topic_stats_client_samples.cc new file mode 100644 index 0000000000000..c5bc709dcbcc1 --- /dev/null +++ b/google/cloud/pubsublite/samples/topic_stats_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/pubsublite/v1/topic_stats.proto + +#include "google/cloud/pubsublite/topic_stats_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::pubsublite::TopicStatsServiceClient( + google::cloud::pubsublite::MakeTopicStatsServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: TopicStatsServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/recommender/samples/recommender_client_samples.cc b/google/cloud/recommender/samples/recommender_client_samples.cc new file mode 100644 index 0000000000000..854e59a5a4b02 --- /dev/null +++ b/google/cloud/recommender/samples/recommender_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/recommender/v1/recommender_service.proto + +#include "google/cloud/recommender/recommender_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::recommender::RecommenderClient( + google::cloud::recommender::MakeRecommenderConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: RecommenderClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/redis/samples/cloud_redis_client_samples.cc b/google/cloud/redis/samples/cloud_redis_client_samples.cc new file mode 100644 index 0000000000000..5c7a402a9c893 --- /dev/null +++ b/google/cloud/redis/samples/cloud_redis_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/redis/v1/cloud_redis.proto + +#include "google/cloud/redis/cloud_redis_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::redis::CloudRedisClient( + google::cloud::redis::MakeCloudRedisConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CloudRedisClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/resourcemanager/samples/folders_client_samples.cc b/google/cloud/resourcemanager/samples/folders_client_samples.cc new file mode 100644 index 0000000000000..5bfa59a74734b --- /dev/null +++ b/google/cloud/resourcemanager/samples/folders_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/resourcemanager/v3/folders.proto + +#include "google/cloud/resourcemanager/folders_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::resourcemanager::FoldersClient( + google::cloud::resourcemanager::MakeFoldersConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: FoldersClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/resourcemanager/samples/organizations_client_samples.cc b/google/cloud/resourcemanager/samples/organizations_client_samples.cc new file mode 100644 index 0000000000000..b7cdf107a81cb --- /dev/null +++ b/google/cloud/resourcemanager/samples/organizations_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/resourcemanager/v3/organizations.proto + +#include "google/cloud/resourcemanager/organizations_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::resourcemanager::OrganizationsClient( + google::cloud::resourcemanager::MakeOrganizationsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: OrganizationsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/resourcemanager/samples/projects_client_samples.cc b/google/cloud/resourcemanager/samples/projects_client_samples.cc new file mode 100644 index 0000000000000..9e726c7acdd41 --- /dev/null +++ b/google/cloud/resourcemanager/samples/projects_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/resourcemanager/v3/projects.proto + +#include "google/cloud/resourcemanager/projects_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::resourcemanager::ProjectsClient( + google::cloud::resourcemanager::MakeProjectsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ProjectsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/resourcesettings/samples/resource_settings_client_samples.cc b/google/cloud/resourcesettings/samples/resource_settings_client_samples.cc new file mode 100644 index 0000000000000..a5d1ef5d6a2eb --- /dev/null +++ b/google/cloud/resourcesettings/samples/resource_settings_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/resourcesettings/v1/resource_settings.proto + +#include "google/cloud/resourcesettings/resource_settings_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::resourcesettings::ResourceSettingsServiceClient( + google::cloud::resourcesettings::MakeResourceSettingsServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ResourceSettingsServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/retail/samples/catalog_client_samples.cc b/google/cloud/retail/samples/catalog_client_samples.cc new file mode 100644 index 0000000000000..2dad1e2418c25 --- /dev/null +++ b/google/cloud/retail/samples/catalog_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/retail/v2/catalog_service.proto + +#include "google/cloud/retail/catalog_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::retail::CatalogServiceClient( + google::cloud::retail::MakeCatalogServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CatalogServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/retail/samples/completion_client_samples.cc b/google/cloud/retail/samples/completion_client_samples.cc new file mode 100644 index 0000000000000..9a7a9ce33e892 --- /dev/null +++ b/google/cloud/retail/samples/completion_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/retail/v2/completion_service.proto + +#include "google/cloud/retail/completion_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::retail::CompletionServiceClient( + google::cloud::retail::MakeCompletionServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CompletionServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/retail/samples/prediction_client_samples.cc b/google/cloud/retail/samples/prediction_client_samples.cc new file mode 100644 index 0000000000000..6443bd9a717a6 --- /dev/null +++ b/google/cloud/retail/samples/prediction_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/retail/v2/prediction_service.proto + +#include "google/cloud/retail/prediction_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::retail::PredictionServiceClient( + google::cloud::retail::MakePredictionServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: PredictionServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/retail/samples/product_client_samples.cc b/google/cloud/retail/samples/product_client_samples.cc new file mode 100644 index 0000000000000..35d5d6be197ae --- /dev/null +++ b/google/cloud/retail/samples/product_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/retail/v2/product_service.proto + +#include "google/cloud/retail/product_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::retail::ProductServiceClient( + google::cloud::retail::MakeProductServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ProductServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/retail/samples/search_client_samples.cc b/google/cloud/retail/samples/search_client_samples.cc new file mode 100644 index 0000000000000..ed868e0db7095 --- /dev/null +++ b/google/cloud/retail/samples/search_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/retail/v2/search_service.proto + +#include "google/cloud/retail/search_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::retail::SearchServiceClient( + google::cloud::retail::MakeSearchServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: SearchServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/retail/samples/user_event_client_samples.cc b/google/cloud/retail/samples/user_event_client_samples.cc new file mode 100644 index 0000000000000..685d70d393602 --- /dev/null +++ b/google/cloud/retail/samples/user_event_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/retail/v2/user_event_service.proto + +#include "google/cloud/retail/user_event_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::retail::UserEventServiceClient( + google::cloud::retail::MakeUserEventServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: UserEventServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/run/samples/revisions_client_samples.cc b/google/cloud/run/samples/revisions_client_samples.cc new file mode 100644 index 0000000000000..bc8301a67ed95 --- /dev/null +++ b/google/cloud/run/samples/revisions_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/run/v2/revision.proto + +#include "google/cloud/run/revisions_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::run::RevisionsClient( + google::cloud::run::MakeRevisionsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: RevisionsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/run/samples/services_client_samples.cc b/google/cloud/run/samples/services_client_samples.cc new file mode 100644 index 0000000000000..af2c59a4401e7 --- /dev/null +++ b/google/cloud/run/samples/services_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/run/v2/service.proto + +#include "google/cloud/run/services_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::run::ServicesClient( + google::cloud::run::MakeServicesConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ServicesClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/scheduler/samples/cloud_scheduler_client_samples.cc b/google/cloud/scheduler/samples/cloud_scheduler_client_samples.cc new file mode 100644 index 0000000000000..d5c51e18ef317 --- /dev/null +++ b/google/cloud/scheduler/samples/cloud_scheduler_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/scheduler/v1/cloudscheduler.proto + +#include "google/cloud/scheduler/cloud_scheduler_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::scheduler::CloudSchedulerClient( + google::cloud::scheduler::MakeCloudSchedulerConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CloudSchedulerClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/secretmanager/samples/secret_manager_client_samples.cc b/google/cloud/secretmanager/samples/secret_manager_client_samples.cc new file mode 100644 index 0000000000000..cf78db9dbd278 --- /dev/null +++ b/google/cloud/secretmanager/samples/secret_manager_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/secretmanager/v1/service.proto + +#include "google/cloud/secretmanager/secret_manager_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::secretmanager::SecretManagerServiceClient( + google::cloud::secretmanager::MakeSecretManagerServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: SecretManagerServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/securitycenter/samples/security_center_client_samples.cc b/google/cloud/securitycenter/samples/security_center_client_samples.cc new file mode 100644 index 0000000000000..42ad751ba643d --- /dev/null +++ b/google/cloud/securitycenter/samples/security_center_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +#include "google/cloud/securitycenter/security_center_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::securitycenter::SecurityCenterClient( + google::cloud::securitycenter::MakeSecurityCenterConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: SecurityCenterClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/servicecontrol/samples/quota_controller_client_samples.cc b/google/cloud/servicecontrol/samples/quota_controller_client_samples.cc new file mode 100644 index 0000000000000..0c487ac3d3774 --- /dev/null +++ b/google/cloud/servicecontrol/samples/quota_controller_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/api/servicecontrol/v1/quota_controller.proto + +#include "google/cloud/servicecontrol/quota_controller_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::servicecontrol::QuotaControllerClient( + google::cloud::servicecontrol::MakeQuotaControllerConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: QuotaControllerClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/servicecontrol/samples/service_controller_client_samples.cc b/google/cloud/servicecontrol/samples/service_controller_client_samples.cc new file mode 100644 index 0000000000000..bef3003e6da76 --- /dev/null +++ b/google/cloud/servicecontrol/samples/service_controller_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/api/servicecontrol/v1/service_controller.proto + +#include "google/cloud/servicecontrol/service_controller_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::servicecontrol::ServiceControllerClient( + google::cloud::servicecontrol::MakeServiceControllerConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ServiceControllerClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/servicedirectory/samples/lookup_client_samples.cc b/google/cloud/servicedirectory/samples/lookup_client_samples.cc new file mode 100644 index 0000000000000..b3ef776559591 --- /dev/null +++ b/google/cloud/servicedirectory/samples/lookup_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/servicedirectory/v1/lookup_service.proto + +#include "google/cloud/servicedirectory/lookup_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::servicedirectory::LookupServiceClient( + google::cloud::servicedirectory::MakeLookupServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: LookupServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/servicedirectory/samples/registration_client_samples.cc b/google/cloud/servicedirectory/samples/registration_client_samples.cc new file mode 100644 index 0000000000000..8a9346ede3b4e --- /dev/null +++ b/google/cloud/servicedirectory/samples/registration_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/servicedirectory/v1/registration_service.proto + +#include "google/cloud/servicedirectory/registration_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::servicedirectory::RegistrationServiceClient( + google::cloud::servicedirectory::MakeRegistrationServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: RegistrationServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/servicemanagement/samples/service_manager_client_samples.cc b/google/cloud/servicemanagement/samples/service_manager_client_samples.cc new file mode 100644 index 0000000000000..ca5e3fb8f5feb --- /dev/null +++ b/google/cloud/servicemanagement/samples/service_manager_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/api/servicemanagement/v1/servicemanager.proto + +#include "google/cloud/servicemanagement/service_manager_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::servicemanagement::ServiceManagerClient( + google::cloud::servicemanagement::MakeServiceManagerConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ServiceManagerClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/serviceusage/samples/service_usage_client_samples.cc b/google/cloud/serviceusage/samples/service_usage_client_samples.cc new file mode 100644 index 0000000000000..51f3d6a806b3b --- /dev/null +++ b/google/cloud/serviceusage/samples/service_usage_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/api/serviceusage/v1/serviceusage.proto + +#include "google/cloud/serviceusage/service_usage_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::serviceusage::ServiceUsageClient( + google::cloud::serviceusage::MakeServiceUsageConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ServiceUsageClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/shell/samples/cloud_shell_client_samples.cc b/google/cloud/shell/samples/cloud_shell_client_samples.cc new file mode 100644 index 0000000000000..1596083b0d26a --- /dev/null +++ b/google/cloud/shell/samples/cloud_shell_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/shell/v1/cloudshell.proto + +#include "google/cloud/shell/cloud_shell_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::shell::CloudShellServiceClient( + google::cloud::shell::MakeCloudShellServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CloudShellServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/spanner/admin/samples/database_admin_client_samples.cc b/google/cloud/spanner/admin/samples/database_admin_client_samples.cc new file mode 100644 index 0000000000000..7bf919f5cdcdb --- /dev/null +++ b/google/cloud/spanner/admin/samples/database_admin_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/spanner/admin/database/v1/spanner_database_admin.proto + +#include "google/cloud/spanner/admin/database_admin_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::spanner_admin::DatabaseAdminClient( + google::cloud::spanner_admin::MakeDatabaseAdminConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: DatabaseAdminClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/spanner/admin/samples/instance_admin_client_samples.cc b/google/cloud/spanner/admin/samples/instance_admin_client_samples.cc new file mode 100644 index 0000000000000..bb520388512eb --- /dev/null +++ b/google/cloud/spanner/admin/samples/instance_admin_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/spanner/admin/instance/v1/spanner_instance_admin.proto + +#include "google/cloud/spanner/admin/instance_admin_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::spanner_admin::InstanceAdminClient( + google::cloud::spanner_admin::MakeInstanceAdminConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: InstanceAdminClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/speech/samples/speech_client_samples.cc b/google/cloud/speech/samples/speech_client_samples.cc new file mode 100644 index 0000000000000..68c2c927addb9 --- /dev/null +++ b/google/cloud/speech/samples/speech_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/speech/v1/cloud_speech.proto + +#include "google/cloud/speech/speech_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::speech::SpeechClient( + google::cloud::speech::MakeSpeechConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: SpeechClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/storagetransfer/samples/storage_transfer_client_samples.cc b/google/cloud/storagetransfer/samples/storage_transfer_client_samples.cc new file mode 100644 index 0000000000000..411fdadca08a2 --- /dev/null +++ b/google/cloud/storagetransfer/samples/storage_transfer_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/storagetransfer/v1/transfer.proto + +#include "google/cloud/storagetransfer/storage_transfer_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::storagetransfer::StorageTransferServiceClient( + google::cloud::storagetransfer::MakeStorageTransferServiceConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: StorageTransferServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/talent/samples/company_client_samples.cc b/google/cloud/talent/samples/company_client_samples.cc new file mode 100644 index 0000000000000..803055d6a8d09 --- /dev/null +++ b/google/cloud/talent/samples/company_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/talent/v4/company_service.proto + +#include "google/cloud/talent/company_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::talent::CompanyServiceClient( + google::cloud::talent::MakeCompanyServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CompanyServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/talent/samples/completion_client_samples.cc b/google/cloud/talent/samples/completion_client_samples.cc new file mode 100644 index 0000000000000..742b8cbb5af23 --- /dev/null +++ b/google/cloud/talent/samples/completion_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/talent/v4/completion_service.proto + +#include "google/cloud/talent/completion_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::talent::CompletionClient( + google::cloud::talent::MakeCompletionConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CompletionClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/talent/samples/event_client_samples.cc b/google/cloud/talent/samples/event_client_samples.cc new file mode 100644 index 0000000000000..bf5aeff8871d6 --- /dev/null +++ b/google/cloud/talent/samples/event_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/talent/v4/event_service.proto + +#include "google/cloud/talent/event_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::talent::EventServiceClient( + google::cloud::talent::MakeEventServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: EventServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/talent/samples/job_client_samples.cc b/google/cloud/talent/samples/job_client_samples.cc new file mode 100644 index 0000000000000..aecf4101e27a6 --- /dev/null +++ b/google/cloud/talent/samples/job_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/talent/v4/job_service.proto + +#include "google/cloud/talent/job_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::talent::JobServiceClient( + google::cloud::talent::MakeJobServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: JobServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/talent/samples/tenant_client_samples.cc b/google/cloud/talent/samples/tenant_client_samples.cc new file mode 100644 index 0000000000000..86daf0eb485e1 --- /dev/null +++ b/google/cloud/talent/samples/tenant_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/talent/v4/tenant_service.proto + +#include "google/cloud/talent/tenant_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::talent::TenantServiceClient( + google::cloud::talent::MakeTenantServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: TenantServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/tasks/samples/cloud_tasks_client_samples.cc b/google/cloud/tasks/samples/cloud_tasks_client_samples.cc new file mode 100644 index 0000000000000..1ab8fd5a47907 --- /dev/null +++ b/google/cloud/tasks/samples/cloud_tasks_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/tasks/v2/cloudtasks.proto + +#include "google/cloud/tasks/cloud_tasks_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::tasks::CloudTasksClient( + google::cloud::tasks::MakeCloudTasksConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: CloudTasksClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/texttospeech/samples/text_to_speech_client_samples.cc b/google/cloud/texttospeech/samples/text_to_speech_client_samples.cc new file mode 100644 index 0000000000000..5753c4641a8e6 --- /dev/null +++ b/google/cloud/texttospeech/samples/text_to_speech_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/texttospeech/v1/cloud_tts.proto + +#include "google/cloud/texttospeech/text_to_speech_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::texttospeech::TextToSpeechClient( + google::cloud::texttospeech::MakeTextToSpeechConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: TextToSpeechClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/tpu/samples/tpu_client_samples.cc b/google/cloud/tpu/samples/tpu_client_samples.cc new file mode 100644 index 0000000000000..46a70174137ee --- /dev/null +++ b/google/cloud/tpu/samples/tpu_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/tpu/v1/cloud_tpu.proto + +#include "google/cloud/tpu/tpu_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::tpu::TpuClient( + google::cloud::tpu::MakeTpuConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: TpuClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/trace/samples/trace_client_samples.cc b/google/cloud/trace/samples/trace_client_samples.cc new file mode 100644 index 0000000000000..5a3f037168913 --- /dev/null +++ b/google/cloud/trace/samples/trace_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/devtools/cloudtrace/v2/tracing.proto + +#include "google/cloud/trace/trace_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::trace::TraceServiceClient( + google::cloud::trace::MakeTraceServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: TraceServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/translate/samples/translation_client_samples.cc b/google/cloud/translate/samples/translation_client_samples.cc new file mode 100644 index 0000000000000..1deb8d522c57b --- /dev/null +++ b/google/cloud/translate/samples/translation_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/translate/v3/translation_service.proto + +#include "google/cloud/translate/translation_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::translate::TranslationServiceClient( + google::cloud::translate::MakeTranslationServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: TranslationServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/video/samples/livestream_client_samples.cc b/google/cloud/video/samples/livestream_client_samples.cc new file mode 100644 index 0000000000000..e8b76ae7377b9 --- /dev/null +++ b/google/cloud/video/samples/livestream_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/video/livestream/v1/service.proto + +#include "google/cloud/video/livestream_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::video::LivestreamServiceClient( + google::cloud::video::MakeLivestreamServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: LivestreamServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/video/samples/transcoder_client_samples.cc b/google/cloud/video/samples/transcoder_client_samples.cc new file mode 100644 index 0000000000000..19e08a90084c2 --- /dev/null +++ b/google/cloud/video/samples/transcoder_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/video/transcoder/v1/services.proto + +#include "google/cloud/video/transcoder_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::video::TranscoderServiceClient( + google::cloud::video::MakeTranscoderServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: TranscoderServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/video/samples/video_stitcher_client_samples.cc b/google/cloud/video/samples/video_stitcher_client_samples.cc new file mode 100644 index 0000000000000..332b930bd453d --- /dev/null +++ b/google/cloud/video/samples/video_stitcher_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/video/stitcher/v1/video_stitcher_service.proto + +#include "google/cloud/video/video_stitcher_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::video::VideoStitcherServiceClient( + google::cloud::video::MakeVideoStitcherServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: VideoStitcherServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/videointelligence/samples/video_intelligence_client_samples.cc b/google/cloud/videointelligence/samples/video_intelligence_client_samples.cc new file mode 100644 index 0000000000000..ac61cda7c30a8 --- /dev/null +++ b/google/cloud/videointelligence/samples/video_intelligence_client_samples.cc @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/videointelligence/v1/video_intelligence.proto + +#include "google/cloud/videointelligence/video_intelligence_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = + google::cloud::videointelligence::VideoIntelligenceServiceClient( + google::cloud::videointelligence:: + MakeVideoIntelligenceServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: VideoIntelligenceServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/vision/samples/image_annotator_client_samples.cc b/google/cloud/vision/samples/image_annotator_client_samples.cc new file mode 100644 index 0000000000000..857501a9e3922 --- /dev/null +++ b/google/cloud/vision/samples/image_annotator_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/vision/v1/image_annotator.proto + +#include "google/cloud/vision/image_annotator_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::vision::ImageAnnotatorClient( + google::cloud::vision::MakeImageAnnotatorConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ImageAnnotatorClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/vision/samples/product_search_client_samples.cc b/google/cloud/vision/samples/product_search_client_samples.cc new file mode 100644 index 0000000000000..c9a7e4771f4b0 --- /dev/null +++ b/google/cloud/vision/samples/product_search_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/vision/v1/product_search_service.proto + +#include "google/cloud/vision/product_search_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::vision::ProductSearchClient( + google::cloud::vision::MakeProductSearchConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ProductSearchClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/vmmigration/samples/vm_migration_client_samples.cc b/google/cloud/vmmigration/samples/vm_migration_client_samples.cc new file mode 100644 index 0000000000000..000c5b980be60 --- /dev/null +++ b/google/cloud/vmmigration/samples/vm_migration_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/vmmigration/v1/vmmigration.proto + +#include "google/cloud/vmmigration/vm_migration_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::vmmigration::VmMigrationClient( + google::cloud::vmmigration::MakeVmMigrationConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: VmMigrationClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/vpcaccess/samples/vpc_access_client_samples.cc b/google/cloud/vpcaccess/samples/vpc_access_client_samples.cc new file mode 100644 index 0000000000000..9ccefc54727ea --- /dev/null +++ b/google/cloud/vpcaccess/samples/vpc_access_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/vpcaccess/v1/vpc_access.proto + +#include "google/cloud/vpcaccess/vpc_access_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::vpcaccess::VpcAccessServiceClient( + google::cloud::vpcaccess::MakeVpcAccessServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: VpcAccessServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/webrisk/samples/web_risk_client_samples.cc b/google/cloud/webrisk/samples/web_risk_client_samples.cc new file mode 100644 index 0000000000000..4d9704a94e890 --- /dev/null +++ b/google/cloud/webrisk/samples/web_risk_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/webrisk/v1/webrisk.proto + +#include "google/cloud/webrisk/web_risk_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::webrisk::WebRiskServiceClient( + google::cloud::webrisk::MakeWebRiskServiceConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: WebRiskServiceClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/websecurityscanner/samples/web_security_scanner_client_samples.cc b/google/cloud/websecurityscanner/samples/web_security_scanner_client_samples.cc new file mode 100644 index 0000000000000..18ae8bc6de145 --- /dev/null +++ b/google/cloud/websecurityscanner/samples/web_security_scanner_client_samples.cc @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +#include "google/cloud/websecurityscanner/web_security_scanner_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::websecurityscanner::WebSecurityScannerClient( + google::cloud::websecurityscanner::MakeWebSecurityScannerConnection( + options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: WebSecurityScannerClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/workflows/samples/executions_client_samples.cc b/google/cloud/workflows/samples/executions_client_samples.cc new file mode 100644 index 0000000000000..3bf4356d8b81c --- /dev/null +++ b/google/cloud/workflows/samples/executions_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/workflows/executions/v1/executions.proto + +#include "google/cloud/workflows/executions_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::workflows::ExecutionsClient( + google::cloud::workflows::MakeExecutionsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: ExecutionsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/workflows/samples/workflows_client_samples.cc b/google/cloud/workflows/samples/workflows_client_samples.cc new file mode 100644 index 0000000000000..6ffc10f869820 --- /dev/null +++ b/google/cloud/workflows/samples/workflows_client_samples.cc @@ -0,0 +1,59 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/workflows/v1/workflows.proto + +#include "google/cloud/workflows/workflows_client.h" +#include "google/cloud/common_options.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include + +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto client = google::cloud::workflows::WorkflowsClient( + google::cloud::workflows::MakeWorkflowsConnection(options)); + // Use the `client` object as usual + //! [set-client-endpoint] +} + +// main-dox-marker: WorkflowsClient +void AutoRun(std::vector const& argv) { + if (!argv.empty()) throw google::cloud::testing_util::Usage{"auto"}; + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +}