Skip to content

Commit 1a15181

Browse files
committed
Run generators and format their outputs
1 parent 9dec3d4 commit 1a15181

Some content is hidden

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

50 files changed

+3834
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,9 @@ See each library's `README.md` file for more information about:
326326
- [Google Cloud Managed Lustre API](google/cloud/lustre/README.md)
327327
[[quickstart]](google/cloud/lustre/quickstart/README.md)
328328
[[reference]](https://cloud.google.com/cpp/docs/reference/lustre/latest)
329+
- [Maintenance API](google/cloud/maintenance/README.md)
330+
[[quickstart]](google/cloud/maintenance/quickstart/README.md)
331+
[[reference]](https://cloud.google.com/cpp/docs/reference/maintenance/latest)
329332
- [Managed Service for Microsoft Active Directory API](google/cloud/managedidentities/README.md)
330333
[[quickstart]](google/cloud/managedidentities/quickstart/README.md)
331334
[[reference]](https://cloud.google.com/cpp/docs/reference/managedidentities/latest)

ci/etc/expected_install_directories

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,11 @@
881881
./include/google/cloud/lustre/v1
882882
./include/google/cloud/lustre/v1/internal
883883
./include/google/cloud/lustre/v1/mocks
884+
./include/google/cloud/maintenance
885+
./include/google/cloud/maintenance/api
886+
./include/google/cloud/maintenance/api/v1
887+
./include/google/cloud/maintenance/api/v1/internal
888+
./include/google/cloud/maintenance/api/v1/mocks
884889
./include/google/cloud/managedidentities
885890
./include/google/cloud/managedidentities/mocks
886891
./include/google/cloud/managedidentities/v1
@@ -1491,6 +1496,8 @@
14911496
./lib64/cmake/google_cloud_cpp_logging_mocks
14921497
./lib64/cmake/google_cloud_cpp_lustre
14931498
./lib64/cmake/google_cloud_cpp_lustre_mocks
1499+
./lib64/cmake/google_cloud_cpp_maintenance
1500+
./lib64/cmake/google_cloud_cpp_maintenance_mocks
14941501
./lib64/cmake/google_cloud_cpp_managedidentities
14951502
./lib64/cmake/google_cloud_cpp_managedidentities_mocks
14961503
./lib64/cmake/google_cloud_cpp_managedkafka
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@com_google_googleapis//google/api:annotations_proto
2+
@com_google_googleapis//google/api:client_proto
3+
@com_google_googleapis//google/api:field_behavior_proto
4+
@com_google_googleapis//google/api:field_info_proto
5+
@com_google_googleapis//google/api:http_proto
6+
@com_google_googleapis//google/api:launch_stage_proto
7+
@com_google_googleapis//google/api:resource_proto
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@com_google_googleapis//google/cloud/maintenance/api/v1:maintenance_service.proto
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
load("//bazel:gapic.bzl", "cc_gapic_library")
16+
17+
package(default_visibility = ["//visibility:private"])
18+
19+
licenses(["notice"]) # Apache 2.0
20+
21+
service_dirs = ["api/v1/"]
22+
23+
googleapis_deps = [
24+
"@com_google_googleapis//google/cloud/maintenance/api/v1:maintenance_cc_grpc",
25+
]
26+
27+
cc_gapic_library(
28+
name = "maintenance",
29+
googleapis_deps = googleapis_deps,
30+
service_dirs = service_dirs,
31+
)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# ~~~
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
# ~~~
16+
17+
include(GoogleCloudCppLibrary)
18+
19+
google_cloud_cpp_add_gapic_library(maintenance "Maintenance API"
20+
SERVICE_DIRS "api/v1/")
21+
22+
if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS)
23+
add_executable(maintenance_quickstart "quickstart/quickstart.cc")
24+
target_link_libraries(maintenance_quickstart
25+
PRIVATE google-cloud-cpp::maintenance)
26+
google_cloud_cpp_add_common_options(maintenance_quickstart)
27+
add_test(
28+
NAME maintenance_quickstart
29+
COMMAND
30+
cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake"
31+
$<TARGET_FILE:maintenance_quickstart> GOOGLE_CLOUD_PROJECT
32+
GOOGLE_CLOUD_CPP_TEST_REGION # EDIT HERE
33+
)
34+
set_tests_properties(maintenance_quickstart
35+
PROPERTIES LABELS "integration-test;quickstart")
36+
endif ()

google/cloud/maintenance/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Maintenance API C++ Client Library
2+
3+
This directory contains an idiomatic C++ client library for the
4+
[Maintenance API][cloud-service-docs].
5+
6+
The Maintenance API provides a centralized view of planned disruptive
7+
maintenance events across supported Google Cloud products. It offers users
8+
visibility into upcoming, ongoing, and completed maintenance, along with
9+
controls to manage certain maintenance activities, such as mainteance windows,
10+
rescheduling, and on-demand updates.
11+
12+
While this library is **GA**, please note that the Google Cloud C++ client
13+
libraries do **not** follow [Semantic Versioning](https://semver.org/).
14+
15+
## Quickstart
16+
17+
The [quickstart/](quickstart/README.md) directory contains a minimal environment
18+
to get started using this client library in a larger project. The following
19+
"Hello World" program is used in this quickstart, and should give you a taste of
20+
this library.
21+
22+
<!-- inject-quickstart-start -->
23+
24+
```cc
25+
#include "google/cloud/maintenance/api/v1/ EDIT HERE _client.h"
26+
#include "google/cloud/location.h"
27+
#include <iostream>
28+
29+
int main(int argc, char* argv[]) try {
30+
if (argc != 3) {
31+
std::cerr << "Usage: " << argv[0] << " project-id location-id\n";
32+
return 1;
33+
}
34+
35+
auto const location = google::cloud::Location(argv[1], argv[2]);
36+
37+
namespace maintenance = ::google::cloud::maintenance_api_v1;
38+
auto client = maintenance::ServiceClient(
39+
maintenance::MakeServiceConnection()); // EDIT HERE
40+
41+
for (auto r : client.List /*EDIT HERE*/ (location.FullName())) {
42+
if (!r) throw std::move(r).status();
43+
std::cout << r->DebugString() << "\n";
44+
}
45+
46+
return 0;
47+
} catch (google::cloud::Status const& status) {
48+
std::cerr << "google::cloud::Status thrown: " << status << "\n";
49+
return 1;
50+
}
51+
```
52+
53+
<!-- inject-quickstart-end -->
54+
55+
## More Information
56+
57+
- Official documentation about the [Maintenance API][cloud-service-docs] service
58+
- [Reference doxygen documentation][doxygen-link] for each release of this
59+
client library
60+
- Detailed header comments in our [public `.h`][source-link] files
61+
62+
[cloud-service-docs]: https://cloud.google.com/unified-maintenance/docs/overview
63+
[doxygen-link]: https://cloud.google.com/cpp/docs/reference/maintenance/latest/
64+
[source-link]: https://github.com/googleapis/google-cloud-cpp/tree/main/google/cloud/maintenance
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Generated by the Codegen C++ plugin.
16+
// If you make any local changes, they will be lost.
17+
// source: google/cloud/maintenance/api/v1/maintenance_service.proto
18+
19+
#include "google/cloud/maintenance/api/v1/internal/maintenance_auth_decorator.h"
20+
#include <google/cloud/maintenance/api/v1/maintenance_service.grpc.pb.h>
21+
#include <memory>
22+
#include <utility>
23+
24+
namespace google {
25+
namespace cloud {
26+
namespace maintenance_api_v1_internal {
27+
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
28+
29+
MaintenanceAuth::MaintenanceAuth(
30+
std::shared_ptr<google::cloud::internal::GrpcAuthenticationStrategy> auth,
31+
std::shared_ptr<MaintenanceStub> child)
32+
: auth_(std::move(auth)), child_(std::move(child)) {}
33+
34+
StatusOr<google::cloud::maintenance::api::v1::SummarizeMaintenancesResponse>
35+
MaintenanceAuth::SummarizeMaintenances(
36+
grpc::ClientContext& context, Options const& options,
37+
google::cloud::maintenance::api::v1::SummarizeMaintenancesRequest const&
38+
request) {
39+
auto status = auth_->ConfigureContext(context);
40+
if (!status.ok()) return status;
41+
return child_->SummarizeMaintenances(context, options, request);
42+
}
43+
44+
StatusOr<google::cloud::maintenance::api::v1::ListResourceMaintenancesResponse>
45+
MaintenanceAuth::ListResourceMaintenances(
46+
grpc::ClientContext& context, Options const& options,
47+
google::cloud::maintenance::api::v1::ListResourceMaintenancesRequest const&
48+
request) {
49+
auto status = auth_->ConfigureContext(context);
50+
if (!status.ok()) return status;
51+
return child_->ListResourceMaintenances(context, options, request);
52+
}
53+
54+
StatusOr<google::cloud::maintenance::api::v1::ResourceMaintenance>
55+
MaintenanceAuth::GetResourceMaintenance(
56+
grpc::ClientContext& context, Options const& options,
57+
google::cloud::maintenance::api::v1::GetResourceMaintenanceRequest const&
58+
request) {
59+
auto status = auth_->ConfigureContext(context);
60+
if (!status.ok()) return status;
61+
return child_->GetResourceMaintenance(context, options, request);
62+
}
63+
64+
StatusOr<google::cloud::location::ListLocationsResponse>
65+
MaintenanceAuth::ListLocations(
66+
grpc::ClientContext& context, Options const& options,
67+
google::cloud::location::ListLocationsRequest const& request) {
68+
auto status = auth_->ConfigureContext(context);
69+
if (!status.ok()) return status;
70+
return child_->ListLocations(context, options, request);
71+
}
72+
73+
StatusOr<google::cloud::location::Location> MaintenanceAuth::GetLocation(
74+
grpc::ClientContext& context, Options const& options,
75+
google::cloud::location::GetLocationRequest const& request) {
76+
auto status = auth_->ConfigureContext(context);
77+
if (!status.ok()) return status;
78+
return child_->GetLocation(context, options, request);
79+
}
80+
81+
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
82+
} // namespace maintenance_api_v1_internal
83+
} // namespace cloud
84+
} // namespace google
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Generated by the Codegen C++ plugin.
16+
// If you make any local changes, they will be lost.
17+
// source: google/cloud/maintenance/api/v1/maintenance_service.proto
18+
19+
#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MAINTENANCE_API_V1_INTERNAL_MAINTENANCE_AUTH_DECORATOR_H
20+
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MAINTENANCE_API_V1_INTERNAL_MAINTENANCE_AUTH_DECORATOR_H
21+
22+
#include "google/cloud/maintenance/api/v1/internal/maintenance_stub.h"
23+
#include "google/cloud/internal/unified_grpc_credentials.h"
24+
#include "google/cloud/version.h"
25+
#include <memory>
26+
#include <set>
27+
#include <string>
28+
29+
namespace google {
30+
namespace cloud {
31+
namespace maintenance_api_v1_internal {
32+
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
33+
34+
class MaintenanceAuth : public MaintenanceStub {
35+
public:
36+
~MaintenanceAuth() override = default;
37+
MaintenanceAuth(
38+
std::shared_ptr<google::cloud::internal::GrpcAuthenticationStrategy> auth,
39+
std::shared_ptr<MaintenanceStub> child);
40+
41+
StatusOr<google::cloud::maintenance::api::v1::SummarizeMaintenancesResponse>
42+
SummarizeMaintenances(
43+
grpc::ClientContext& context, Options const& options,
44+
google::cloud::maintenance::api::v1::SummarizeMaintenancesRequest const&
45+
request) override;
46+
47+
StatusOr<
48+
google::cloud::maintenance::api::v1::ListResourceMaintenancesResponse>
49+
ListResourceMaintenances(
50+
grpc::ClientContext& context, Options const& options,
51+
google::cloud::maintenance::api::v1::
52+
ListResourceMaintenancesRequest const& request) override;
53+
54+
StatusOr<google::cloud::maintenance::api::v1::ResourceMaintenance>
55+
GetResourceMaintenance(
56+
grpc::ClientContext& context, Options const& options,
57+
google::cloud::maintenance::api::v1::GetResourceMaintenanceRequest const&
58+
request) override;
59+
60+
StatusOr<google::cloud::location::ListLocationsResponse> ListLocations(
61+
grpc::ClientContext& context, Options const& options,
62+
google::cloud::location::ListLocationsRequest const& request) override;
63+
64+
StatusOr<google::cloud::location::Location> GetLocation(
65+
grpc::ClientContext& context, Options const& options,
66+
google::cloud::location::GetLocationRequest const& request) override;
67+
68+
private:
69+
std::shared_ptr<google::cloud::internal::GrpcAuthenticationStrategy> auth_;
70+
std::shared_ptr<MaintenanceStub> child_;
71+
};
72+
73+
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
74+
} // namespace maintenance_api_v1_internal
75+
} // namespace cloud
76+
} // namespace google
77+
78+
#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MAINTENANCE_API_V1_INTERNAL_MAINTENANCE_AUTH_DECORATOR_H

0 commit comments

Comments
 (0)