-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
197 changed files
with
11,664 additions
and
0 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
google/cloud/accessapproval/samples/access_approval_client_samples.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <iostream> | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace { | ||
|
||
void SetClientEndpoint(std::vector<std::string> 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<google::cloud::EndpointOption>( | ||
"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<std::string> 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); | ||
} |
60 changes: 60 additions & 0 deletions
60
google/cloud/accesscontextmanager/samples/access_context_manager_client_samples.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <iostream> | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace { | ||
|
||
void SetClientEndpoint(std::vector<std::string> 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<google::cloud::EndpointOption>( | ||
"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<std::string> 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); | ||
} |
59 changes: 59 additions & 0 deletions
59
google/cloud/apigateway/samples/api_gateway_client_samples.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <iostream> | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace { | ||
|
||
void SetClientEndpoint(std::vector<std::string> 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<google::cloud::EndpointOption>( | ||
"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<std::string> 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); | ||
} |
59 changes: 59 additions & 0 deletions
59
google/cloud/apigeeconnect/samples/connection_client_samples.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <iostream> | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace { | ||
|
||
void SetClientEndpoint(std::vector<std::string> 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<google::cloud::EndpointOption>( | ||
"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<std::string> 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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <iostream> | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace { | ||
|
||
void SetClientEndpoint(std::vector<std::string> 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<google::cloud::EndpointOption>( | ||
"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<std::string> 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); | ||
} |
59 changes: 59 additions & 0 deletions
59
google/cloud/appengine/samples/applications_client_samples.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <iostream> | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace { | ||
|
||
void SetClientEndpoint(std::vector<std::string> 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<google::cloud::EndpointOption>( | ||
"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<std::string> 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); | ||
} |
Oops, something went wrong.