Skip to content

Commit 88972d0

Browse files
authored
feat(contactcenterinsights): generate library (#8235)
1 parent d5d0977 commit 88972d0

43 files changed

Lines changed: 8710 additions & 0 deletions

Some content is hidden

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

BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ EXPERIMENTAL_LIBRARIES = [
3434
"channel",
3535
"cloudbuild",
3636
"composer",
37+
"contactcenterinsights",
3738
"container",
3839
"containeranalysis",
3940
"datacatalog",

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ releasing them early in case they elicit some feedback that requires changes.
115115
<summary> Expand to see the full list of new libraries...</summary>
116116
<br>
117117

118+
* [Contact Center AI Insights](https://github.com/googleapis/google-cloud-cpp/blob/main/google/cloud/contactcenterinsights/README.md)
118119
* [Data Catalog](https://github.com/googleapis/google-cloud-cpp/blob/main/google/cloud/datacatalog/README.md)
119120
* [Managed Service for Microsoft Active Directory](https://github.com/googleapis/google-cloud-cpp/blob/main/google/cloud/managedidentities/README.md)
120121
* [Natural Language AI](https://github.com/googleapis/google-cloud-cpp/blob/main/google/cloud/language/README.md)

ci/etc/expected_install_directories

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@
7373
./include/google/cloud/composer
7474
./include/google/cloud/composer/internal
7575
./include/google/cloud/composer/mocks
76+
./include/google/cloud/contactcenterinsights
77+
./include/google/cloud/contactcenterinsights/internal
78+
./include/google/cloud/contactcenterinsights/mocks
79+
./include/google/cloud/contactcenterinsights/v1
7680
./include/google/cloud/container
7781
./include/google/cloud/container/internal
7882
./include/google/cloud/container/mocks
@@ -356,6 +360,7 @@
356360
./lib64/cmake/google_cloud_cpp_channel
357361
./lib64/cmake/google_cloud_cpp_cloudbuild
358362
./lib64/cmake/google_cloud_cpp_composer
363+
./lib64/cmake/google_cloud_cpp_contactcenterinsights
359364
./lib64/cmake/google_cloud_cpp_container
360365
./lib64/cmake/google_cloud_cpp_containeranalysis
361366
./lib64/cmake/google_cloud_cpp_datacatalog

ci/etc/full_feature_list

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ binaryauthorization
1212
channel
1313
cloudbuild
1414
composer
15+
contactcenterinsights
1516
container
1617
containeranalysis
1718
datacatalog
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:http_proto
5+
@com_google_googleapis//google/api:resource_proto
6+
@com_google_googleapis//google/longrunning:operations_proto
7+
@com_google_googleapis//google/rpc:status_proto
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@com_google_googleapis//google/cloud/contactcenterinsights/v1:contact_center_insights.proto
2+
@com_google_googleapis//google/cloud/contactcenterinsights/v1:resources.proto

external/googleapis/update_libraries.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ declare -A -r LIBRARIES=(
5757
["cloudbuild"]="@com_google_googleapis//google/devtools/cloudbuild/v1:cloudbuild_cc_grpc"
5858
["common"]="@com_google_googleapis//google/cloud/common:common_cc_grpc"
5959
["composer"]="@com_google_googleapis//google/cloud/orchestration/airflow/service/v1:service_cc_grpc"
60+
["contactcenterinsights"]="@com_google_googleapis//google/cloud/contactcenterinsights/v1:contactcenterinsights_cc_grpc"
6061
["container"]="@com_google_googleapis//google/container/v1:container_cc_grpc"
6162
["containeranalysis"]="@com_google_googleapis//google/devtools/containeranalysis/v1:containeranalysis_cc_grpc"
6263
["datacatalog"]="@com_google_googleapis//google/cloud/datacatalog/v1:datacatalog_cc_grpc"

generator/generator_config.textproto

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,14 @@ service {
202202
retryable_status_codes: ["kUnavailable"]
203203
}
204204

205+
# Contact Center AI Insights
206+
service {
207+
service_proto_path: "google/cloud/contactcenterinsights/v1/contact_center_insights.proto"
208+
product_path: "google/cloud/contactcenterinsights"
209+
initial_copyright_year: "2022"
210+
retryable_status_codes: ["kUnavailable"]
211+
}
212+
205213
# Container
206214
service {
207215
service_proto_path: "google/container/v1/cluster_service.proto"
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Copyright 2022 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+
package(default_visibility = ["//visibility:private"])
16+
17+
licenses(["notice"]) # Apache 2.0
18+
19+
SOURCE_GLOB = "**/*.cc"
20+
21+
MOCK_SOURCE_GLOB = "mocks/*.cc"
22+
23+
HEADER_GLOB = "**/*.h"
24+
25+
MOCK_HEADER_GLOB = "mocks/*.h"
26+
27+
cc_library(
28+
name = "google_cloud_cpp_contactcenterinsights",
29+
srcs = glob(
30+
include = [SOURCE_GLOB],
31+
exclude = [MOCK_SOURCE_GLOB],
32+
),
33+
hdrs = glob(
34+
include = [HEADER_GLOB],
35+
exclude = [MOCK_HEADER_GLOB],
36+
),
37+
visibility = ["//:__pkg__"],
38+
deps = [
39+
"//google/cloud:google_cloud_cpp_common",
40+
"//google/cloud:google_cloud_cpp_grpc_utils",
41+
"@com_google_googleapis//google/cloud/contactcenterinsights/v1:contactcenterinsights_cc_grpc",
42+
],
43+
)
44+
45+
cc_library(
46+
name = "google_cloud_cpp_contactcenterinsights_mocks",
47+
srcs = glob(
48+
include = [MOCK_SOURCE_GLOB],
49+
),
50+
hdrs = glob(
51+
include = [MOCK_HEADER_GLOB],
52+
),
53+
visibility = ["//:__pkg__"],
54+
deps = [
55+
":google_cloud_cpp_contactcenterinsights",
56+
"//google/cloud:google_cloud_cpp_common",
57+
"//google/cloud:google_cloud_cpp_grpc_utils",
58+
],
59+
)
Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
# ~~~
2+
# Copyright 2022 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(GoogleapisConfig)
18+
set(DOXYGEN_PROJECT_NAME "Contact Center AI Insights API C++ Client")
19+
set(DOXYGEN_PROJECT_BRIEF
20+
"A C++ Client Library for the Contact Center AI Insights API")
21+
set(DOXYGEN_PROJECT_NUMBER "${PROJECT_VERSION} (Experimental)")
22+
set(DOXYGEN_EXCLUDE_SYMBOLS "internal" "contactcenterinsights_internal"
23+
"contactcenterinsights_testing" "examples")
24+
set(DOXYGEN_EXAMPLE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/quickstart)
25+
26+
# Creates the proto headers needed by doxygen.
27+
set(GOOGLE_CLOUD_CPP_DOXYGEN_DEPS
28+
google-cloud-cpp::contactcenterinsights_protos)
29+
30+
find_package(gRPC REQUIRED)
31+
find_package(ProtobufWithTargets REQUIRED)
32+
find_package(absl CONFIG REQUIRED)
33+
34+
include(GoogleCloudCppCommon)
35+
36+
set(EXTERNAL_GOOGLEAPIS_SOURCE
37+
"${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download")
38+
find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto)
39+
if (PROTO_INCLUDE_DIR)
40+
list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}")
41+
endif ()
42+
43+
include(CompileProtos)
44+
google_cloud_cpp_grpcpp_library(
45+
google_cloud_cpp_contactcenterinsights_protos
46+
# cmake-format: sort
47+
${EXTERNAL_GOOGLEAPIS_SOURCE}/google/cloud/contactcenterinsights/v1/contact_center_insights.proto
48+
${EXTERNAL_GOOGLEAPIS_SOURCE}/google/cloud/contactcenterinsights/v1/resources.proto
49+
PROTO_PATH_DIRECTORIES
50+
"${EXTERNAL_GOOGLEAPIS_SOURCE}"
51+
"${PROTO_INCLUDE_DIR}")
52+
external_googleapis_set_version_and_alias(contactcenterinsights_protos)
53+
target_link_libraries(
54+
google_cloud_cpp_contactcenterinsights_protos
55+
PUBLIC #
56+
google-cloud-cpp::api_annotations_protos
57+
google-cloud-cpp::api_client_protos
58+
google-cloud-cpp::api_field_behavior_protos
59+
google-cloud-cpp::api_http_protos
60+
google-cloud-cpp::api_resource_protos
61+
google-cloud-cpp::longrunning_operations_protos
62+
google-cloud-cpp::rpc_status_protos)
63+
64+
file(
65+
GLOB source_files
66+
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
67+
"*.h" "*.cc" "internal/*.h" "internal/*.cc")
68+
list(SORT source_files)
69+
add_library(google_cloud_cpp_contactcenterinsights ${source_files})
70+
target_include_directories(
71+
google_cloud_cpp_contactcenterinsights
72+
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
73+
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
74+
$<INSTALL_INTERFACE:include>)
75+
target_link_libraries(
76+
google_cloud_cpp_contactcenterinsights
77+
PUBLIC google-cloud-cpp::grpc_utils google-cloud-cpp::common
78+
google-cloud-cpp::contactcenterinsights_protos)
79+
google_cloud_cpp_add_common_options(google_cloud_cpp_contactcenterinsights)
80+
set_target_properties(
81+
google_cloud_cpp_contactcenterinsights
82+
PROPERTIES EXPORT_NAME google-cloud-cpp::experimental-contactcenterinsights
83+
VERSION "${PROJECT_VERSION}" SOVERSION
84+
"${PROJECT_VERSION_MAJOR}")
85+
target_compile_options(google_cloud_cpp_contactcenterinsights
86+
PUBLIC ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG})
87+
88+
add_library(google-cloud-cpp::experimental-contactcenterinsights ALIAS
89+
google_cloud_cpp_contactcenterinsights)
90+
91+
# Create a header-only library for the mocks. We use a CMake `INTERFACE` library
92+
# for these, a regular library would not work on macOS (where the library needs
93+
# at least one .o file). Unfortunately INTERFACE libraries are a bit weird in
94+
# that they need absolute paths for their sources.
95+
file(
96+
GLOB relative_mock_files
97+
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
98+
"mocks/*.h")
99+
list(SORT relative_mock_files)
100+
set(mock_files)
101+
foreach (file IN LISTS relative_mock_files)
102+
list(APPEND mock_files "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
103+
endforeach ()
104+
add_library(google_cloud_cpp_contactcenterinsights_mocks INTERFACE)
105+
target_sources(google_cloud_cpp_contactcenterinsights_mocks
106+
INTERFACE ${mock_files})
107+
target_link_libraries(
108+
google_cloud_cpp_contactcenterinsights_mocks
109+
INTERFACE google-cloud-cpp::experimental-contactcenterinsights
110+
GTest::gmock_main GTest::gmock GTest::gtest)
111+
set_target_properties(
112+
google_cloud_cpp_contactcenterinsights_mocks
113+
PROPERTIES EXPORT_NAME
114+
google-cloud-cpp::experimental-contactcenterinsights_mocks)
115+
target_include_directories(
116+
google_cloud_cpp_contactcenterinsights_mocks
117+
INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
118+
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
119+
$<INSTALL_INTERFACE:include>)
120+
target_compile_options(google_cloud_cpp_contactcenterinsights_mocks
121+
INTERFACE ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG})
122+
123+
# Get the destination directories based on the GNU recommendations.
124+
include(GNUInstallDirs)
125+
126+
# Export the CMake targets to make it easy to create configuration files.
127+
install(
128+
EXPORT google_cloud_cpp_contactcenterinsights-targets
129+
DESTINATION
130+
"${CMAKE_INSTALL_LIBDIR}/cmake/google_cloud_cpp_contactcenterinsights"
131+
COMPONENT google_cloud_cpp_development)
132+
133+
# Install the libraries and headers in the locations determined by
134+
# GNUInstallDirs
135+
install(
136+
TARGETS google_cloud_cpp_contactcenterinsights
137+
google_cloud_cpp_contactcenterinsights_protos
138+
EXPORT google_cloud_cpp_contactcenterinsights-targets
139+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
140+
COMPONENT google_cloud_cpp_runtime
141+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
142+
COMPONENT google_cloud_cpp_runtime
143+
NAMELINK_SKIP
144+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
145+
COMPONENT google_cloud_cpp_development)
146+
# With CMake-3.12 and higher we could avoid this separate command (and the
147+
# duplication).
148+
install(
149+
TARGETS google_cloud_cpp_contactcenterinsights
150+
google_cloud_cpp_contactcenterinsights_protos
151+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
152+
COMPONENT google_cloud_cpp_development
153+
NAMELINK_ONLY
154+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
155+
COMPONENT google_cloud_cpp_development)
156+
157+
google_cloud_cpp_install_proto_library_protos(
158+
"google_cloud_cpp_contactcenterinsights_protos"
159+
"${EXTERNAL_GOOGLEAPIS_SOURCE}")
160+
google_cloud_cpp_install_proto_library_headers(
161+
"google_cloud_cpp_contactcenterinsights_protos")
162+
google_cloud_cpp_install_headers("google_cloud_cpp_contactcenterinsights"
163+
"include/google/cloud/contactcenterinsights")
164+
google_cloud_cpp_install_headers("google_cloud_cpp_contactcenterinsights_mocks"
165+
"include/google/cloud/contactcenterinsights")
166+
167+
# Setup global variables used in the following *.in files.
168+
set(GOOGLE_CLOUD_CONFIG_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
169+
set(GOOGLE_CLOUD_CONFIG_VERSION_MINOR ${PROJECT_VERSION_MINOR})
170+
set(GOOGLE_CLOUD_CONFIG_VERSION_PATCH ${PROJECT_VERSION_PATCH})
171+
set(GOOGLE_CLOUD_PC_NAME
172+
"The Contact Center AI Insights API C++ Client Library")
173+
set(GOOGLE_CLOUD_PC_DESCRIPTION
174+
"Provides C++ APIs to use the Contact Center AI Insights API.")
175+
set(GOOGLE_CLOUD_PC_LIBS "-lgoogle_cloud_cpp_contactcenterinsights")
176+
string(CONCAT GOOGLE_CLOUD_PC_REQUIRES "google_cloud_cpp_grpc_utils"
177+
" google_cloud_cpp_common"
178+
" google_cloud_cpp_contactcenterinsights_protos")
179+
180+
# Create and install the pkg-config files.
181+
configure_file(
182+
"${PROJECT_SOURCE_DIR}/google/cloud/contactcenterinsights/config.pc.in"
183+
"google_cloud_cpp_contactcenterinsights.pc" @ONLY)
184+
install(
185+
FILES
186+
"${CMAKE_CURRENT_BINARY_DIR}/google_cloud_cpp_contactcenterinsights.pc"
187+
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
188+
COMPONENT google_cloud_cpp_development)
189+
190+
# Create and install the CMake configuration files.
191+
include(CMakePackageConfigHelpers)
192+
configure_file("config.cmake.in"
193+
"google_cloud_cpp_contactcenterinsights-config.cmake" @ONLY)
194+
write_basic_package_version_file(
195+
"google_cloud_cpp_contactcenterinsights-config-version.cmake"
196+
VERSION ${PROJECT_VERSION}
197+
COMPATIBILITY ExactVersion)
198+
199+
install(
200+
FILES
201+
"${CMAKE_CURRENT_BINARY_DIR}/google_cloud_cpp_contactcenterinsights-config.cmake"
202+
"${CMAKE_CURRENT_BINARY_DIR}/google_cloud_cpp_contactcenterinsights-config-version.cmake"
203+
DESTINATION
204+
"${CMAKE_INSTALL_LIBDIR}/cmake/google_cloud_cpp_contactcenterinsights"
205+
COMPONENT google_cloud_cpp_development)
206+
207+
external_googleapis_install_pc("google_cloud_cpp_contactcenterinsights_protos"
208+
"${PROJECT_SOURCE_DIR}/external/googleapis")

0 commit comments

Comments
 (0)