google-cloud-cloudcontrolspartner 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. google/cloud/cloudcontrolspartner/__init__.py +115 -0
  2. google/cloud/cloudcontrolspartner/gapic_version.py +16 -0
  3. google/cloud/cloudcontrolspartner/py.typed +2 -0
  4. google/cloud/cloudcontrolspartner_v1/__init__.py +103 -0
  5. google/cloud/cloudcontrolspartner_v1/gapic_metadata.json +197 -0
  6. google/cloud/cloudcontrolspartner_v1/gapic_version.py +16 -0
  7. google/cloud/cloudcontrolspartner_v1/py.typed +2 -0
  8. google/cloud/cloudcontrolspartner_v1/services/__init__.py +15 -0
  9. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_core/__init__.py +22 -0
  10. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_core/async_client.py +1253 -0
  11. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_core/client.py +1705 -0
  12. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_core/pagers.py +429 -0
  13. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_core/transports/__init__.py +41 -0
  14. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_core/transports/base.py +340 -0
  15. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_core/transports/grpc.py +466 -0
  16. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_core/transports/grpc_asyncio.py +472 -0
  17. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_core/transports/rest.py +1212 -0
  18. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_monitoring/__init__.py +22 -0
  19. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_monitoring/async_client.py +528 -0
  20. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_monitoring/client.py +935 -0
  21. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_monitoring/pagers.py +155 -0
  22. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_monitoring/transports/__init__.py +41 -0
  23. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_monitoring/transports/base.py +194 -0
  24. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_monitoring/transports/grpc.py +300 -0
  25. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_monitoring/transports/grpc_asyncio.py +299 -0
  26. google/cloud/cloudcontrolspartner_v1/services/cloud_controls_partner_monitoring/transports/rest.py +434 -0
  27. google/cloud/cloudcontrolspartner_v1/types/__init__.py +82 -0
  28. google/cloud/cloudcontrolspartner_v1/types/access_approval_requests.py +228 -0
  29. google/cloud/cloudcontrolspartner_v1/types/completion_state.py +53 -0
  30. google/cloud/cloudcontrolspartner_v1/types/core.py +93 -0
  31. google/cloud/cloudcontrolspartner_v1/types/customer_workloads.py +300 -0
  32. google/cloud/cloudcontrolspartner_v1/types/customers.py +233 -0
  33. google/cloud/cloudcontrolspartner_v1/types/ekm_connections.py +141 -0
  34. google/cloud/cloudcontrolspartner_v1/types/monitoring.py +24 -0
  35. google/cloud/cloudcontrolspartner_v1/types/partner_permissions.py +94 -0
  36. google/cloud/cloudcontrolspartner_v1/types/partners.py +188 -0
  37. google/cloud/cloudcontrolspartner_v1/types/violations.py +388 -0
  38. google/cloud/cloudcontrolspartner_v1beta/__init__.py +103 -0
  39. google/cloud/cloudcontrolspartner_v1beta/gapic_metadata.json +197 -0
  40. google/cloud/cloudcontrolspartner_v1beta/gapic_version.py +16 -0
  41. google/cloud/cloudcontrolspartner_v1beta/py.typed +2 -0
  42. google/cloud/cloudcontrolspartner_v1beta/services/__init__.py +15 -0
  43. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_core/__init__.py +22 -0
  44. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_core/async_client.py +1262 -0
  45. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_core/client.py +1714 -0
  46. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_core/pagers.py +429 -0
  47. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_core/transports/__init__.py +41 -0
  48. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_core/transports/base.py +340 -0
  49. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_core/transports/grpc.py +466 -0
  50. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_core/transports/grpc_asyncio.py +472 -0
  51. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_core/transports/rest.py +1212 -0
  52. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_monitoring/__init__.py +22 -0
  53. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_monitoring/async_client.py +530 -0
  54. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_monitoring/client.py +937 -0
  55. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_monitoring/pagers.py +155 -0
  56. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_monitoring/transports/__init__.py +41 -0
  57. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_monitoring/transports/base.py +194 -0
  58. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_monitoring/transports/grpc.py +300 -0
  59. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_monitoring/transports/grpc_asyncio.py +299 -0
  60. google/cloud/cloudcontrolspartner_v1beta/services/cloud_controls_partner_monitoring/transports/rest.py +434 -0
  61. google/cloud/cloudcontrolspartner_v1beta/types/__init__.py +82 -0
  62. google/cloud/cloudcontrolspartner_v1beta/types/access_approval_requests.py +230 -0
  63. google/cloud/cloudcontrolspartner_v1beta/types/completion_state.py +53 -0
  64. google/cloud/cloudcontrolspartner_v1beta/types/core.py +93 -0
  65. google/cloud/cloudcontrolspartner_v1beta/types/customer_workloads.py +304 -0
  66. google/cloud/cloudcontrolspartner_v1beta/types/customers.py +236 -0
  67. google/cloud/cloudcontrolspartner_v1beta/types/ekm_connections.py +143 -0
  68. google/cloud/cloudcontrolspartner_v1beta/types/monitoring.py +24 -0
  69. google/cloud/cloudcontrolspartner_v1beta/types/partner_permissions.py +96 -0
  70. google/cloud/cloudcontrolspartner_v1beta/types/partners.py +189 -0
  71. google/cloud/cloudcontrolspartner_v1beta/types/violations.py +391 -0
  72. google_cloud_cloudcontrolspartner-0.1.0.dist-info/LICENSE +202 -0
  73. google_cloud_cloudcontrolspartner-0.1.0.dist-info/METADATA +137 -0
  74. google_cloud_cloudcontrolspartner-0.1.0.dist-info/RECORD +76 -0
  75. google_cloud_cloudcontrolspartner-0.1.0.dist-info/WHEEL +5 -0
  76. google_cloud_cloudcontrolspartner-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,299 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2023 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
+ # http://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
+ from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
17
+ import warnings
18
+
19
+ from google.api_core import gapic_v1, grpc_helpers_async
20
+ from google.auth import credentials as ga_credentials # type: ignore
21
+ from google.auth.transport.grpc import SslCredentials # type: ignore
22
+ import grpc # type: ignore
23
+ from grpc.experimental import aio # type: ignore
24
+
25
+ from google.cloud.cloudcontrolspartner_v1beta.types import violations
26
+
27
+ from .base import DEFAULT_CLIENT_INFO, CloudControlsPartnerMonitoringTransport
28
+ from .grpc import CloudControlsPartnerMonitoringGrpcTransport
29
+
30
+
31
+ class CloudControlsPartnerMonitoringGrpcAsyncIOTransport(
32
+ CloudControlsPartnerMonitoringTransport
33
+ ):
34
+ """gRPC AsyncIO backend transport for CloudControlsPartnerMonitoring.
35
+
36
+ Service describing handlers for resources
37
+
38
+ This class defines the same methods as the primary client, so the
39
+ primary client can load the underlying transport implementation
40
+ and call it.
41
+
42
+ It sends protocol buffers over the wire using gRPC (which is built on
43
+ top of HTTP/2); the ``grpcio`` package must be installed.
44
+ """
45
+
46
+ _grpc_channel: aio.Channel
47
+ _stubs: Dict[str, Callable] = {}
48
+
49
+ @classmethod
50
+ def create_channel(
51
+ cls,
52
+ host: str = "cloudcontrolspartner.googleapis.com",
53
+ credentials: Optional[ga_credentials.Credentials] = None,
54
+ credentials_file: Optional[str] = None,
55
+ scopes: Optional[Sequence[str]] = None,
56
+ quota_project_id: Optional[str] = None,
57
+ **kwargs,
58
+ ) -> aio.Channel:
59
+ """Create and return a gRPC AsyncIO channel object.
60
+ Args:
61
+ host (Optional[str]): The host for the channel to use.
62
+ credentials (Optional[~.Credentials]): The
63
+ authorization credentials to attach to requests. These
64
+ credentials identify this application to the service. If
65
+ none are specified, the client will attempt to ascertain
66
+ the credentials from the environment.
67
+ credentials_file (Optional[str]): A file with credentials that can
68
+ be loaded with :func:`google.auth.load_credentials_from_file`.
69
+ This argument is ignored if ``channel`` is provided.
70
+ scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
71
+ service. These are only used when credentials are not specified and
72
+ are passed to :func:`google.auth.default`.
73
+ quota_project_id (Optional[str]): An optional project to use for billing
74
+ and quota.
75
+ kwargs (Optional[dict]): Keyword arguments, which are passed to the
76
+ channel creation.
77
+ Returns:
78
+ aio.Channel: A gRPC AsyncIO channel object.
79
+ """
80
+
81
+ return grpc_helpers_async.create_channel(
82
+ host,
83
+ credentials=credentials,
84
+ credentials_file=credentials_file,
85
+ quota_project_id=quota_project_id,
86
+ default_scopes=cls.AUTH_SCOPES,
87
+ scopes=scopes,
88
+ default_host=cls.DEFAULT_HOST,
89
+ **kwargs,
90
+ )
91
+
92
+ def __init__(
93
+ self,
94
+ *,
95
+ host: str = "cloudcontrolspartner.googleapis.com",
96
+ credentials: Optional[ga_credentials.Credentials] = None,
97
+ credentials_file: Optional[str] = None,
98
+ scopes: Optional[Sequence[str]] = None,
99
+ channel: Optional[aio.Channel] = None,
100
+ api_mtls_endpoint: Optional[str] = None,
101
+ client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
102
+ ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
103
+ client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
104
+ quota_project_id: Optional[str] = None,
105
+ client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
106
+ always_use_jwt_access: Optional[bool] = False,
107
+ api_audience: Optional[str] = None,
108
+ ) -> None:
109
+ """Instantiate the transport.
110
+
111
+ Args:
112
+ host (Optional[str]):
113
+ The hostname to connect to (default: 'cloudcontrolspartner.googleapis.com').
114
+ credentials (Optional[google.auth.credentials.Credentials]): The
115
+ authorization credentials to attach to requests. These
116
+ credentials identify the application to the service; if none
117
+ are specified, the client will attempt to ascertain the
118
+ credentials from the environment.
119
+ This argument is ignored if ``channel`` is provided.
120
+ credentials_file (Optional[str]): A file with credentials that can
121
+ be loaded with :func:`google.auth.load_credentials_from_file`.
122
+ This argument is ignored if ``channel`` is provided.
123
+ scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
124
+ service. These are only used when credentials are not specified and
125
+ are passed to :func:`google.auth.default`.
126
+ channel (Optional[aio.Channel]): A ``Channel`` instance through
127
+ which to make calls.
128
+ api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
129
+ If provided, it overrides the ``host`` argument and tries to create
130
+ a mutual TLS channel with client SSL credentials from
131
+ ``client_cert_source`` or application default SSL credentials.
132
+ client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]):
133
+ Deprecated. A callback to provide client SSL certificate bytes and
134
+ private key bytes, both in PEM format. It is ignored if
135
+ ``api_mtls_endpoint`` is None.
136
+ ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
137
+ for the grpc channel. It is ignored if ``channel`` is provided.
138
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
139
+ A callback to provide client certificate bytes and private key bytes,
140
+ both in PEM format. It is used to configure a mutual TLS channel. It is
141
+ ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
142
+ quota_project_id (Optional[str]): An optional project to use for billing
143
+ and quota.
144
+ client_info (google.api_core.gapic_v1.client_info.ClientInfo):
145
+ The client info used to send a user-agent string along with
146
+ API requests. If ``None``, then default info will be used.
147
+ Generally, you only need to set this if you're developing
148
+ your own client library.
149
+ always_use_jwt_access (Optional[bool]): Whether self signed JWT should
150
+ be used for service account credentials.
151
+
152
+ Raises:
153
+ google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
154
+ creation failed for any reason.
155
+ google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials``
156
+ and ``credentials_file`` are passed.
157
+ """
158
+ self._grpc_channel = None
159
+ self._ssl_channel_credentials = ssl_channel_credentials
160
+ self._stubs: Dict[str, Callable] = {}
161
+
162
+ if api_mtls_endpoint:
163
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
164
+ if client_cert_source:
165
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
166
+
167
+ if channel:
168
+ # Ignore credentials if a channel was passed.
169
+ credentials = False
170
+ # If a channel was explicitly provided, set it.
171
+ self._grpc_channel = channel
172
+ self._ssl_channel_credentials = None
173
+ else:
174
+ if api_mtls_endpoint:
175
+ host = api_mtls_endpoint
176
+
177
+ # Create SSL credentials with client_cert_source or application
178
+ # default SSL credentials.
179
+ if client_cert_source:
180
+ cert, key = client_cert_source()
181
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
182
+ certificate_chain=cert, private_key=key
183
+ )
184
+ else:
185
+ self._ssl_channel_credentials = SslCredentials().ssl_credentials
186
+
187
+ else:
188
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
189
+ cert, key = client_cert_source_for_mtls()
190
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
191
+ certificate_chain=cert, private_key=key
192
+ )
193
+
194
+ # The base transport sets the host, credentials and scopes
195
+ super().__init__(
196
+ host=host,
197
+ credentials=credentials,
198
+ credentials_file=credentials_file,
199
+ scopes=scopes,
200
+ quota_project_id=quota_project_id,
201
+ client_info=client_info,
202
+ always_use_jwt_access=always_use_jwt_access,
203
+ api_audience=api_audience,
204
+ )
205
+
206
+ if not self._grpc_channel:
207
+ self._grpc_channel = type(self).create_channel(
208
+ self._host,
209
+ # use the credentials which are saved
210
+ credentials=self._credentials,
211
+ # Set ``credentials_file`` to ``None`` here as
212
+ # the credentials that we saved earlier should be used.
213
+ credentials_file=None,
214
+ scopes=self._scopes,
215
+ ssl_credentials=self._ssl_channel_credentials,
216
+ quota_project_id=quota_project_id,
217
+ options=[
218
+ ("grpc.max_send_message_length", -1),
219
+ ("grpc.max_receive_message_length", -1),
220
+ ],
221
+ )
222
+
223
+ # Wrap messages. This must be done after self._grpc_channel exists
224
+ self._prep_wrapped_messages(client_info)
225
+
226
+ @property
227
+ def grpc_channel(self) -> aio.Channel:
228
+ """Create the channel designed to connect to this service.
229
+
230
+ This property caches on the instance; repeated calls return
231
+ the same channel.
232
+ """
233
+ # Return the channel from cache.
234
+ return self._grpc_channel
235
+
236
+ @property
237
+ def list_violations(
238
+ self,
239
+ ) -> Callable[
240
+ [violations.ListViolationsRequest], Awaitable[violations.ListViolationsResponse]
241
+ ]:
242
+ r"""Return a callable for the list violations method over gRPC.
243
+
244
+ Lists Violations for a workload Callers may also choose to read
245
+ across multiple Customers or for a single customer as per
246
+ `AIP-159 <https://google.aip.dev/159>`__ by using '-' (the
247
+ hyphen or dash character) as a wildcard character instead of
248
+ {customer} & {workload}. Format:
249
+ ``organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}``
250
+
251
+ Returns:
252
+ Callable[[~.ListViolationsRequest],
253
+ Awaitable[~.ListViolationsResponse]]:
254
+ A function that, when called, will call the underlying RPC
255
+ on the server.
256
+ """
257
+ # Generate a "stub function" on-the-fly which will actually make
258
+ # the request.
259
+ # gRPC handles serialization and deserialization, so we just need
260
+ # to pass in the functions for each.
261
+ if "list_violations" not in self._stubs:
262
+ self._stubs["list_violations"] = self.grpc_channel.unary_unary(
263
+ "/google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoring/ListViolations",
264
+ request_serializer=violations.ListViolationsRequest.serialize,
265
+ response_deserializer=violations.ListViolationsResponse.deserialize,
266
+ )
267
+ return self._stubs["list_violations"]
268
+
269
+ @property
270
+ def get_violation(
271
+ self,
272
+ ) -> Callable[[violations.GetViolationRequest], Awaitable[violations.Violation]]:
273
+ r"""Return a callable for the get violation method over gRPC.
274
+
275
+ Gets details of a single Violation.
276
+
277
+ Returns:
278
+ Callable[[~.GetViolationRequest],
279
+ Awaitable[~.Violation]]:
280
+ A function that, when called, will call the underlying RPC
281
+ on the server.
282
+ """
283
+ # Generate a "stub function" on-the-fly which will actually make
284
+ # the request.
285
+ # gRPC handles serialization and deserialization, so we just need
286
+ # to pass in the functions for each.
287
+ if "get_violation" not in self._stubs:
288
+ self._stubs["get_violation"] = self.grpc_channel.unary_unary(
289
+ "/google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoring/GetViolation",
290
+ request_serializer=violations.GetViolationRequest.serialize,
291
+ response_deserializer=violations.Violation.deserialize,
292
+ )
293
+ return self._stubs["get_violation"]
294
+
295
+ def close(self):
296
+ return self.grpc_channel.close()
297
+
298
+
299
+ __all__ = ("CloudControlsPartnerMonitoringGrpcAsyncIOTransport",)