Esempio n. 1
0
def update(environment, api_properties, api_definition, icon, connector_id,
           powerapps_url, powerapps_version, client_secret, 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))
def create(environment, api_properties, api_definition, icon, powerapps_url,
           powerapps_version, client_secret, settings_file,
           overwrite_settings):
    """
    Create command.
    """
    settings, powerapps_rp, _ = load_settings_and_powerapps_rp(
        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,
        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))