Skip to content

Commit

Permalink
feat: [google-apps-meet] Add ConnectActiveConference method to `Spa…
Browse files Browse the repository at this point in the history
…cesService` (#13554)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 730566327

Source-Link:
googleapis/googleapis@1674757

Source-Link:
googleapis/googleapis-gen@ec2d7f0
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFwcHMtbWVldC8uT3dsQm90LnlhbWwiLCJoIjoiZWMyZDdmMGQxNzE0ZmJlNTEyMTJmNmIxMmFkZWM5MGY3OTcwNzA4MyJ9

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Feb 25, 2025
1 parent fdff960 commit 576bb98
Show file tree
Hide file tree
Showing 22 changed files with 1,910 additions and 55 deletions.
4 changes: 2 additions & 2 deletions packages/google-apps-meet/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ In order to use this library, you first need to go through the following steps:
1. `Select or create a Cloud Platform project.`_
2. `Enable billing for your project.`_
3. `Enable the Google Meet API.`_
4. `Setup Authentication.`_
4. `Set up Authentication.`_

.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
.. _Enable the Google Meet API.: https://developers.google.com/meet/api/guides/overview
.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
.. _Set up Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html

Installation
~~~~~~~~~~~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.1.13" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.1.13" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
4 changes: 4 additions & 0 deletions packages/google-apps-meet/google/apps/meet_v2beta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
TranscriptEntry,
)
from .types.service import (
ConnectActiveConferenceRequest,
ConnectActiveConferenceResponse,
CreateMemberRequest,
CreateSpaceRequest,
DeleteMemberRequest,
Expand Down Expand Up @@ -77,6 +79,8 @@
"AnonymousUser",
"ConferenceRecord",
"ConferenceRecordsServiceClient",
"ConnectActiveConferenceRequest",
"ConnectActiveConferenceResponse",
"CreateMemberRequest",
"CreateSpaceRequest",
"DeleteMemberRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@
"grpc": {
"libraryClient": "SpacesServiceClient",
"rpcs": {
"ConnectActiveConference": {
"methods": [
"connect_active_conference"
]
},
"CreateMember": {
"methods": [
"create_member"
Expand Down Expand Up @@ -254,6 +259,11 @@
"grpc-async": {
"libraryClient": "SpacesServiceAsyncClient",
"rpcs": {
"ConnectActiveConference": {
"methods": [
"connect_active_conference"
]
},
"CreateMember": {
"methods": [
"create_member"
Expand Down Expand Up @@ -299,6 +309,11 @@
"rest": {
"libraryClient": "SpacesServiceClient",
"rpcs": {
"ConnectActiveConference": {
"methods": [
"connect_active_conference"
]
},
"CreateMember": {
"methods": [
"create_member"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.1.13" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,134 @@ async def sample_update_space():
# Done; return the response.
return response

async def connect_active_conference(
self,
request: Optional[Union[service.ConnectActiveConferenceRequest, dict]] = None,
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> service.ConnectActiveConferenceResponse:
r"""`Developer
Preview <https://developers.google.com/workspace/preview>`__:
Broker a WebRTC connection to the active conference of a space.
On success, clients must use the resulting SDP (Session
Description Protocol) answer to establish a WebRTC connection.
Once connected, additional functionality is available across
WebRTC data channels.
See `Meet Media API
overview <https://developers.google.com/meet/media-api/guides/overview>`__
for more details about this connection.
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.apps import meet_v2beta
async def sample_connect_active_conference():
# Create a client
client = meet_v2beta.SpacesServiceAsyncClient()
# Initialize request argument(s)
request = meet_v2beta.ConnectActiveConferenceRequest(
name="name_value",
offer="offer_value",
)
# Make the request
response = await client.connect_active_conference(request=request)
# Handle the response
print(response)
Args:
request (Optional[Union[google.apps.meet_v2beta.types.ConnectActiveConferenceRequest, dict]]):
The request object. Request to establish a WebRTC
connection to the active conference of a
space.
name (:class:`str`):
Required. Resource name of the space.
Format: spaces/{spaceId}
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
sent along with the request as metadata. Normally, each value must be of type `str`,
but for metadata keys ending with the suffix `-bin`, the corresponding values must
be of type `bytes`.
Returns:
google.apps.meet_v2beta.types.ConnectActiveConferenceResponse:
Response of ConnectActiveConference method.
A success response does not indicate the meeting is
fully joined; further communication must occur across
WebRTC.
See [Meet Media API
overview](\ https://developers.google.com/meet/media-api/guides/overview)
for more details about this connection.
"""
# Create or coerce a protobuf request object.
# - Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([name])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

# - Use the request object if provided (there's no risk of modifying the input as
# there are no flattened fields), or create one.
if not isinstance(request, service.ConnectActiveConferenceRequest):
request = service.ConnectActiveConferenceRequest(request)

# If we have keyword arguments corresponding to fields on the
# request, apply these.
if name is not None:
request.name = name

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._client._transport._wrapped_methods[
self._client._transport.connect_active_conference
]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response

async def end_active_conference(
self,
request: Optional[Union[service.EndActiveConferenceRequest, dict]] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,133 @@ def sample_update_space():
# Done; return the response.
return response

def connect_active_conference(
self,
request: Optional[Union[service.ConnectActiveConferenceRequest, dict]] = None,
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> service.ConnectActiveConferenceResponse:
r"""`Developer
Preview <https://developers.google.com/workspace/preview>`__:
Broker a WebRTC connection to the active conference of a space.
On success, clients must use the resulting SDP (Session
Description Protocol) answer to establish a WebRTC connection.
Once connected, additional functionality is available across
WebRTC data channels.
See `Meet Media API
overview <https://developers.google.com/meet/media-api/guides/overview>`__
for more details about this connection.
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.apps import meet_v2beta
def sample_connect_active_conference():
# Create a client
client = meet_v2beta.SpacesServiceClient()
# Initialize request argument(s)
request = meet_v2beta.ConnectActiveConferenceRequest(
name="name_value",
offer="offer_value",
)
# Make the request
response = client.connect_active_conference(request=request)
# Handle the response
print(response)
Args:
request (Union[google.apps.meet_v2beta.types.ConnectActiveConferenceRequest, dict]):
The request object. Request to establish a WebRTC
connection to the active conference of a
space.
name (str):
Required. Resource name of the space.
Format: spaces/{spaceId}
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
sent along with the request as metadata. Normally, each value must be of type `str`,
but for metadata keys ending with the suffix `-bin`, the corresponding values must
be of type `bytes`.
Returns:
google.apps.meet_v2beta.types.ConnectActiveConferenceResponse:
Response of ConnectActiveConference method.
A success response does not indicate the meeting is
fully joined; further communication must occur across
WebRTC.
See [Meet Media API
overview](\ https://developers.google.com/meet/media-api/guides/overview)
for more details about this connection.
"""
# Create or coerce a protobuf request object.
# - Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([name])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

# - Use the request object if provided (there's no risk of modifying the input as
# there are no flattened fields), or create one.
if not isinstance(request, service.ConnectActiveConferenceRequest):
request = service.ConnectActiveConferenceRequest(request)
# If we have keyword arguments corresponding to fields on the
# request, apply these.
if name is not None:
request.name = name

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[
self._transport.connect_active_conference
]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)

# Validate the universe domain.
self._validate_universe_domain()

# Send the request.
response = rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response

def end_active_conference(
self,
request: Optional[Union[service.EndActiveConferenceRequest, dict]] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class SpacesServiceTransport(abc.ABC):
"""Abstract transport class for SpacesService."""

AUTH_SCOPES = (
"https://www.googleapis.com/auth/meetings.conference.media.audio.readonly",
"https://www.googleapis.com/auth/meetings.conference.media.readonly",
"https://www.googleapis.com/auth/meetings.conference.media.video.readonly",
"https://www.googleapis.com/auth/meetings.space.created",
"https://www.googleapis.com/auth/meetings.space.readonly",
"https://www.googleapis.com/auth/meetings.space.settings",
Expand Down Expand Up @@ -157,6 +160,11 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.connect_active_conference: gapic_v1.method.wrap_method(
self.connect_active_conference,
default_timeout=None,
client_info=client_info,
),
self.end_active_conference: gapic_v1.method.wrap_method(
self.end_active_conference,
default_timeout=60.0,
Expand Down Expand Up @@ -217,6 +225,18 @@ def update_space(
]:
raise NotImplementedError()

@property
def connect_active_conference(
self,
) -> Callable[
[service.ConnectActiveConferenceRequest],
Union[
service.ConnectActiveConferenceResponse,
Awaitable[service.ConnectActiveConferenceResponse],
],
]:
raise NotImplementedError()

@property
def end_active_conference(
self,
Expand Down
Loading

0 comments on commit 576bb98

Please sign in to comment.