Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
settings_file):
"""
Update command.
"""
# Get settings
settings = SettingsBuilder.get_settings(
environment=environment,
settings_file=settings_file,
api_properties=api_properties,
api_definition=api_definition,
icon=icon,
connector_id=connector_id,
powerapps_url=powerapps_url,
powerapps_version=powerapps_version)
powerapps_rp, _ = load_powerapps_and_flow_rp(
settings=settings,
command_context=_UPDATE)
connector_id = upsert(
powerapps_rp=powerapps_rp,
settings=settings,
client_secret=client_secret,
is_update=True,
overwrite_settings=False)
display('{} updated successfully.'.format(connector_id))
overwrite_settings):
"""
Create command.
"""
# Get settings
settings = SettingsBuilder.get_settings(
environment=environment,
settings_file=settings_file,
api_properties=api_properties,
api_definition=api_definition,
icon=icon,
connector_id=None,
powerapps_url=powerapps_url,
powerapps_version=powerapps_version)
powerapps_rp, _ = load_powerapps_and_flow_rp(
settings=settings,
command_context=_CREATE)
connector_id = upsert(
powerapps_rp=powerapps_rp,
settings=settings,
client_secret=client_secret,
is_update=False,
overwrite_settings=overwrite_settings)
display('{} created successfully.'.format(connector_id))
settings_file):
"""
Validate command.
"""
# Get settings
settings = SettingsBuilder.get_settings(
environment=None,
settings_file=settings_file,
api_properties=None,
api_definition=api_definition,
icon=None,
connector_id=None,
powerapps_url=powerapps_url,
powerapps_version=powerapps_version)
powerapps_rp, _ = load_powerapps_and_flow_rp(
settings=settings,
command_context=_VALIDATE)
result = paconn.operations.validate.validate(
powerapps_rp=powerapps_rp,
settings=settings)
if result:
display(result)
else:
display('{} validated successfully.'.format(settings.api_definition))
overwrite):
"""
Download command.
"""
# Get settings
settings = SettingsBuilder.get_settings(
environment=environment,
settings_file=settings_file,
api_properties=None,
api_definition=None,
icon=None,
connector_id=None,
powerapps_url=powerapps_url,
powerapps_version=powerapps_version)
powerapps_rp, _ = load_powerapps_and_flow_rp(
settings=settings,
command_context=_DOWNLOAD)
directory = paconn.operations.download.download(
powerapps_rp=powerapps_rp,
settings=settings,
destination=destination,
overwrite=overwrite)
display('The connector is downloaded to {}.'.format(directory))