Skip to content

Commit

Permalink
Change obj to environment_obj for backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
MRyderOC authored Feb 8, 2024
1 parent 4ec03f7 commit 73b99d2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/dfcx_scrapi/core/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,26 +293,26 @@ def create_environment_by_display_name(
def update_environment(
self,
environment_id: str,
obj: types.Environment = None,
environment_obj: types.Environment = None,
**kwargs):
"""Update an existing environment for a specified agent.
Args:
environment_id: The specified environment to update.
obj: Optional Environment object of types.Environment
environment_obj: Optional Environment object of types.Environment
that can be provided when you are planning to replace the full
object vs. just partial updates.
Returns:
An object representing a long-running operation. (LRO)
"""
if obj:
env = obj
if environment_obj:
env = environment_obj
env.name = environment_id
mask = self._update_kwargs(obj)
mask = self._update_kwargs(environment_obj)
elif kwargs:
env = self.get_environment(environment_id)
mask = self._update_kwargs(obj, **kwargs)
mask = self._update_kwargs(environment_obj, **kwargs)

request = types.environment.UpdateEnvironmentRequest(
environment=env, update_mask=mask)
Expand Down

0 comments on commit 73b99d2

Please sign in to comment.