Skip to content

Commit 156245e

Browse files
committed
regenerated samples
1 parent 7cff22c commit 156245e

File tree

480 files changed

+3379
-1440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

480 files changed

+3379
-1440
lines changed

google/cloud/accessapproval/v1/samples/access_approval_client_samples.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "google/cloud/credentials.h"
2424
#include "google/cloud/internal/getenv.h"
2525
#include "google/cloud/testing_util/example_driver.h"
26+
#include "google/cloud/universe_domain.h"
2627
#include <fstream>
2728
#include <iostream>
2829
#include <string>
@@ -58,13 +59,12 @@ void SetClientUniverseDomain(std::vector<std::string> const& argv) {
5859
// in the provided Options for the Universe Domain associated with the
5960
// credentials and adds it to the set of Options.
6061
// If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used.
61-
ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
62+
auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
6263

6364
if (!ud_options.ok()) throw std::move(ud_options).status();
6465
auto ud_client = google::cloud::accessapproval_v1::AccessApprovalClient(
6566
google::cloud::accessapproval_v1::MakeAccessApprovalConnection(
66-
ud_options));
67-
67+
*ud_options));
6868
//! [set-client-universe-domain]
6969
}
7070

@@ -163,6 +163,9 @@ void AutoRun(std::vector<std::string> const& argv) {
163163
std::cout << "\nRunning SetRetryPolicy() example" << std::endl;
164164
SetRetryPolicy({});
165165

166+
std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl;
167+
SetClientUniverseDomain({});
168+
166169
std::cout << "\nRunning WithServiceAccount() example" << std::endl;
167170
WithServiceAccount({keyfile});
168171
}
@@ -174,6 +177,7 @@ int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape)
174177
{"set-client-endpoint", SetClientEndpoint},
175178
{"set-retry-policy", SetRetryPolicy},
176179
{"with-service-account", WithServiceAccount},
180+
{"set-client-universe-domain", SetClientUniverseDomain},
177181
{"auto", AutoRun},
178182
});
179183
return example.Run(argc, argv);

google/cloud/accesscontextmanager/v1/samples/access_context_manager_client_samples.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "google/cloud/internal/getenv.h"
2525
#include "google/cloud/polling_policy.h"
2626
#include "google/cloud/testing_util/example_driver.h"
27+
#include "google/cloud/universe_domain.h"
2728
#include <fstream>
2829
#include <iostream>
2930
#include <string>
@@ -62,14 +63,13 @@ void SetClientUniverseDomain(std::vector<std::string> const& argv) {
6263
// in the provided Options for the Universe Domain associated with the
6364
// credentials and adds it to the set of Options.
6465
// If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used.
65-
ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
66+
auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
6667

6768
if (!ud_options.ok()) throw std::move(ud_options).status();
6869
auto ud_client =
6970
google::cloud::accesscontextmanager_v1::AccessContextManagerClient(
7071
google::cloud::accesscontextmanager_v1::
71-
MakeAccessContextManagerConnection(ud_options));
72-
72+
MakeAccessContextManagerConnection(*ud_options));
7373
//! [set-client-universe-domain]
7474
}
7575

@@ -215,6 +215,9 @@ void AutoRun(std::vector<std::string> const& argv) {
215215
std::cout << "\nRunning SetRetryPolicy() example" << std::endl;
216216
SetRetryPolicy({});
217217

218+
std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl;
219+
SetClientUniverseDomain({});
220+
218221
std::cout << "\nRunning SetPollingPolicy() example" << std::endl;
219222
SetPollingPolicy({});
220223

@@ -230,6 +233,7 @@ int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape)
230233
{"set-retry-policy", SetRetryPolicy},
231234
{"set-polling-policy", SetPollingPolicy},
232235
{"with-service-account", WithServiceAccount},
236+
{"set-client-universe-domain", SetClientUniverseDomain},
233237
{"auto", AutoRun},
234238
});
235239
return example.Run(argc, argv);

google/cloud/advisorynotifications/v1/samples/advisory_notifications_client_samples.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "google/cloud/credentials.h"
2424
#include "google/cloud/internal/getenv.h"
2525
#include "google/cloud/testing_util/example_driver.h"
26+
#include "google/cloud/universe_domain.h"
2627
#include <fstream>
2728
#include <iostream>
2829
#include <string>
@@ -60,14 +61,13 @@ void SetClientUniverseDomain(std::vector<std::string> const& argv) {
6061
// in the provided Options for the Universe Domain associated with the
6162
// credentials and adds it to the set of Options.
6263
// If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used.
63-
ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
64+
auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
6465

6566
if (!ud_options.ok()) throw std::move(ud_options).status();
6667
auto ud_client = google::cloud::advisorynotifications_v1::
6768
AdvisoryNotificationsServiceClient(
6869
google::cloud::advisorynotifications_v1::
69-
MakeAdvisoryNotificationsServiceConnection(ud_options));
70-
70+
MakeAdvisoryNotificationsServiceConnection(*ud_options));
7171
//! [set-client-universe-domain]
7272
}
7373

@@ -174,6 +174,9 @@ void AutoRun(std::vector<std::string> const& argv) {
174174
std::cout << "\nRunning SetRetryPolicy() example" << std::endl;
175175
SetRetryPolicy({});
176176

177+
std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl;
178+
SetClientUniverseDomain({});
179+
177180
std::cout << "\nRunning WithServiceAccount() example" << std::endl;
178181
WithServiceAccount({keyfile});
179182
}
@@ -185,6 +188,7 @@ int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape)
185188
{"set-client-endpoint", SetClientEndpoint},
186189
{"set-retry-policy", SetRetryPolicy},
187190
{"with-service-account", WithServiceAccount},
191+
{"set-client-universe-domain", SetClientUniverseDomain},
188192
{"auto", AutoRun},
189193
});
190194
return example.Run(argc, argv);

google/cloud/aiplatform/v1/samples/dataset_client_samples.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "google/cloud/internal/getenv.h"
2525
#include "google/cloud/polling_policy.h"
2626
#include "google/cloud/testing_util/example_driver.h"
27+
#include "google/cloud/universe_domain.h"
2728
#include <fstream>
2829
#include <iostream>
2930
#include <string>
@@ -61,12 +62,11 @@ void SetClientUniverseDomain(std::vector<std::string> const& argv) {
6162
// in the provided Options for the Universe Domain associated with the
6263
// credentials and adds it to the set of Options.
6364
// If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used.
64-
ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
65+
auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
6566

6667
if (!ud_options.ok()) throw std::move(ud_options).status();
6768
auto ud_client = google::cloud::aiplatform_v1::DatasetServiceClient(
68-
google::cloud::aiplatform_v1::MakeDatasetServiceConnection(ud_options));
69-
69+
google::cloud::aiplatform_v1::MakeDatasetServiceConnection(*ud_options));
7070
//! [set-client-universe-domain]
7171
}
7272

@@ -203,6 +203,9 @@ void AutoRun(std::vector<std::string> const& argv) {
203203
std::cout << "\nRunning SetRetryPolicy() example" << std::endl;
204204
SetRetryPolicy({});
205205

206+
std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl;
207+
SetClientUniverseDomain({});
208+
206209
std::cout << "\nRunning SetPollingPolicy() example" << std::endl;
207210
SetPollingPolicy({});
208211

@@ -218,6 +221,7 @@ int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape)
218221
{"set-retry-policy", SetRetryPolicy},
219222
{"set-polling-policy", SetPollingPolicy},
220223
{"with-service-account", WithServiceAccount},
224+
{"set-client-universe-domain", SetClientUniverseDomain},
221225
{"auto", AutoRun},
222226
});
223227
return example.Run(argc, argv);

google/cloud/aiplatform/v1/samples/deployment_resource_pool_client_samples.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "google/cloud/internal/getenv.h"
2525
#include "google/cloud/polling_policy.h"
2626
#include "google/cloud/testing_util/example_driver.h"
27+
#include "google/cloud/universe_domain.h"
2728
#include <fstream>
2829
#include <iostream>
2930
#include <string>
@@ -62,14 +63,13 @@ void SetClientUniverseDomain(std::vector<std::string> const& argv) {
6263
// in the provided Options for the Universe Domain associated with the
6364
// credentials and adds it to the set of Options.
6465
// If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used.
65-
ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
66+
auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
6667

6768
if (!ud_options.ok()) throw std::move(ud_options).status();
6869
auto ud_client =
6970
google::cloud::aiplatform_v1::DeploymentResourcePoolServiceClient(
7071
google::cloud::aiplatform_v1::
71-
MakeDeploymentResourcePoolServiceConnection(ud_options));
72-
72+
MakeDeploymentResourcePoolServiceConnection(*ud_options));
7373
//! [set-client-universe-domain]
7474
}
7575

@@ -220,6 +220,9 @@ void AutoRun(std::vector<std::string> const& argv) {
220220
std::cout << "\nRunning SetRetryPolicy() example" << std::endl;
221221
SetRetryPolicy({});
222222

223+
std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl;
224+
SetClientUniverseDomain({});
225+
223226
std::cout << "\nRunning SetPollingPolicy() example" << std::endl;
224227
SetPollingPolicy({});
225228

@@ -235,6 +238,7 @@ int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape)
235238
{"set-retry-policy", SetRetryPolicy},
236239
{"set-polling-policy", SetPollingPolicy},
237240
{"with-service-account", WithServiceAccount},
241+
{"set-client-universe-domain", SetClientUniverseDomain},
238242
{"auto", AutoRun},
239243
});
240244
return example.Run(argc, argv);

google/cloud/aiplatform/v1/samples/endpoint_client_samples.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "google/cloud/internal/getenv.h"
2525
#include "google/cloud/polling_policy.h"
2626
#include "google/cloud/testing_util/example_driver.h"
27+
#include "google/cloud/universe_domain.h"
2728
#include <fstream>
2829
#include <iostream>
2930
#include <string>
@@ -61,12 +62,11 @@ void SetClientUniverseDomain(std::vector<std::string> const& argv) {
6162
// in the provided Options for the Universe Domain associated with the
6263
// credentials and adds it to the set of Options.
6364
// If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used.
64-
ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
65+
auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
6566

6667
if (!ud_options.ok()) throw std::move(ud_options).status();
6768
auto ud_client = google::cloud::aiplatform_v1::EndpointServiceClient(
68-
google::cloud::aiplatform_v1::MakeEndpointServiceConnection(ud_options));
69-
69+
google::cloud::aiplatform_v1::MakeEndpointServiceConnection(*ud_options));
7070
//! [set-client-universe-domain]
7171
}
7272

@@ -205,6 +205,9 @@ void AutoRun(std::vector<std::string> const& argv) {
205205
std::cout << "\nRunning SetRetryPolicy() example" << std::endl;
206206
SetRetryPolicy({});
207207

208+
std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl;
209+
SetClientUniverseDomain({});
210+
208211
std::cout << "\nRunning SetPollingPolicy() example" << std::endl;
209212
SetPollingPolicy({});
210213

@@ -220,6 +223,7 @@ int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape)
220223
{"set-retry-policy", SetRetryPolicy},
221224
{"set-polling-policy", SetPollingPolicy},
222225
{"with-service-account", WithServiceAccount},
226+
{"set-client-universe-domain", SetClientUniverseDomain},
223227
{"auto", AutoRun},
224228
});
225229
return example.Run(argc, argv);

google/cloud/aiplatform/v1/samples/evaluation_client_samples.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "google/cloud/credentials.h"
2424
#include "google/cloud/internal/getenv.h"
2525
#include "google/cloud/testing_util/example_driver.h"
26+
#include "google/cloud/universe_domain.h"
2627
#include <fstream>
2728
#include <iostream>
2829
#include <string>
@@ -59,13 +60,12 @@ void SetClientUniverseDomain(std::vector<std::string> const& argv) {
5960
// in the provided Options for the Universe Domain associated with the
6061
// credentials and adds it to the set of Options.
6162
// If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used.
62-
ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
63+
auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
6364

6465
if (!ud_options.ok()) throw std::move(ud_options).status();
6566
auto ud_client = google::cloud::aiplatform_v1::EvaluationServiceClient(
6667
google::cloud::aiplatform_v1::MakeEvaluationServiceConnection(
67-
ud_options));
68-
68+
*ud_options));
6969
//! [set-client-universe-domain]
7070
}
7171

@@ -168,6 +168,9 @@ void AutoRun(std::vector<std::string> const& argv) {
168168
std::cout << "\nRunning SetRetryPolicy() example" << std::endl;
169169
SetRetryPolicy({});
170170

171+
std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl;
172+
SetClientUniverseDomain({});
173+
171174
std::cout << "\nRunning WithServiceAccount() example" << std::endl;
172175
WithServiceAccount({keyfile});
173176
}
@@ -179,6 +182,7 @@ int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape)
179182
{"set-client-endpoint", SetClientEndpoint},
180183
{"set-retry-policy", SetRetryPolicy},
181184
{"with-service-account", WithServiceAccount},
185+
{"set-client-universe-domain", SetClientUniverseDomain},
182186
{"auto", AutoRun},
183187
});
184188
return example.Run(argc, argv);

google/cloud/aiplatform/v1/samples/feature_online_store_admin_client_samples.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "google/cloud/internal/getenv.h"
2525
#include "google/cloud/polling_policy.h"
2626
#include "google/cloud/testing_util/example_driver.h"
27+
#include "google/cloud/universe_domain.h"
2728
#include <fstream>
2829
#include <iostream>
2930
#include <string>
@@ -62,14 +63,13 @@ void SetClientUniverseDomain(std::vector<std::string> const& argv) {
6263
// in the provided Options for the Universe Domain associated with the
6364
// credentials and adds it to the set of Options.
6465
// If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used.
65-
ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
66+
auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
6667

6768
if (!ud_options.ok()) throw std::move(ud_options).status();
6869
auto ud_client =
6970
google::cloud::aiplatform_v1::FeatureOnlineStoreAdminServiceClient(
7071
google::cloud::aiplatform_v1::
71-
MakeFeatureOnlineStoreAdminServiceConnection(ud_options));
72-
72+
MakeFeatureOnlineStoreAdminServiceConnection(*ud_options));
7373
//! [set-client-universe-domain]
7474
}
7575

@@ -220,6 +220,9 @@ void AutoRun(std::vector<std::string> const& argv) {
220220
std::cout << "\nRunning SetRetryPolicy() example" << std::endl;
221221
SetRetryPolicy({});
222222

223+
std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl;
224+
SetClientUniverseDomain({});
225+
223226
std::cout << "\nRunning SetPollingPolicy() example" << std::endl;
224227
SetPollingPolicy({});
225228

@@ -235,6 +238,7 @@ int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape)
235238
{"set-retry-policy", SetRetryPolicy},
236239
{"set-polling-policy", SetPollingPolicy},
237240
{"with-service-account", WithServiceAccount},
241+
{"set-client-universe-domain", SetClientUniverseDomain},
238242
{"auto", AutoRun},
239243
});
240244
return example.Run(argc, argv);

google/cloud/aiplatform/v1/samples/feature_online_store_client_samples.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "google/cloud/credentials.h"
2424
#include "google/cloud/internal/getenv.h"
2525
#include "google/cloud/testing_util/example_driver.h"
26+
#include "google/cloud/universe_domain.h"
2627
#include <fstream>
2728
#include <iostream>
2829
#include <string>
@@ -60,14 +61,13 @@ void SetClientUniverseDomain(std::vector<std::string> const& argv) {
6061
// in the provided Options for the Universe Domain associated with the
6162
// credentials and adds it to the set of Options.
6263
// If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used.
63-
ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
64+
auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options));
6465

6566
if (!ud_options.ok()) throw std::move(ud_options).status();
6667
auto ud_client =
6768
google::cloud::aiplatform_v1::FeatureOnlineStoreServiceClient(
6869
google::cloud::aiplatform_v1::MakeFeatureOnlineStoreServiceConnection(
69-
ud_options));
70-
70+
*ud_options));
7171
//! [set-client-universe-domain]
7272
}
7373

@@ -171,6 +171,9 @@ void AutoRun(std::vector<std::string> const& argv) {
171171
std::cout << "\nRunning SetRetryPolicy() example" << std::endl;
172172
SetRetryPolicy({});
173173

174+
std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl;
175+
SetClientUniverseDomain({});
176+
174177
std::cout << "\nRunning WithServiceAccount() example" << std::endl;
175178
WithServiceAccount({keyfile});
176179
}
@@ -182,6 +185,7 @@ int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape)
182185
{"set-client-endpoint", SetClientEndpoint},
183186
{"set-retry-policy", SetRetryPolicy},
184187
{"with-service-account", WithServiceAccount},
188+
{"set-client-universe-domain", SetClientUniverseDomain},
185189
{"auto", AutoRun},
186190
});
187191
return example.Run(argc, argv);

0 commit comments

Comments
 (0)