def _set(self, opts):
    cmd = 'create'
    if opts.edit:
        cmd = 'edit'
    if ((opts.dataverse is None) and (opts.scope is None)):
        _exit_if_errors([f'--dataverse or --scope is required to {cmd} a link'])
    if (opts.name is None):
        _exit_if_errors([f'--name is required to {cmd} a link'])
    if (opts.create and (opts.type is None)):
        _exit_if_errors([f'--type is required to {cmd} a link'])
    if (opts.type == 'azureblob'):
        if ((opts.connection_string is None) and (opts.account_key is None) and (opts.shared_access_signature is None)):
            _exit_if_errors(['No authentication parameters provided'])
        if (opts.connection_string and (opts.account_key or opts.shared_access_signature)):
            _exit_if_errors(['Only a single authentication method is allowed'])
        if (opts.account_key and opts.shared_access_signature):
            _exit_if_errors(['Only a single authentication method is allowed'])
    if opts.dataverse:
        opts.scope = opts.dataverse
    if opts.certificate:
        opts.certificate = _exit_on_file_read_failure(opts.certificate)
    if opts.user_key:
        opts.user_key = _exit_on_file_read_failure(opts.user_key)
    if opts.user_certificate:
        opts.user_certificate = _exit_on_file_read_failure(opts.user_certificate)
    if opts.create:
        (_, errors) = self.rest.create_analytics_link(opts)
        _exit_if_errors(errors)
        _success('Link created')
    else:
        (_, errors) = self.rest.edit_analytics_link(opts)
        _exit_if_errors(errors)
        _success('Link edited')
def _set(self, opts):
    cmd = 'create'
    if opts.edit:
        cmd = 'edit'
    if ((opts.dataverse is None) and (opts.scope is None)):
        _exit_if_errors([f'--dataverse or --scope is required to {cmd} a link'])
    if (opts.name is None):
        _exit_if_errors([f'--name is required to {cmd} a link'])
    if (opts.create and (opts.type is None)):
        _exit_if_errors([f'--type is required to {cmd} a link'])
    if (opts.type == 'azureblob'):
        if ((opts.connection_string is None) and (opts.account_key is None) and (opts.shared_access_signature is None)):
            _exit_if_errors(['No authentication parameters provided'])
        if (opts.connection_string and (opts.account_key or opts.shared_access_signature)):
            _exit_if_errors(['Only a single authentication method is allowed'])
        if (opts.account_key and opts.shared_access_signature):
            _exit_if_errors(['Only a single authentication method is allowed'])
    if opts.dataverse:
        opts.scope = opts.dataverse
    if opts.certificate:
        opts.certificate = _exit_on_file_read_failure(opts.certificate)
    if opts.user_key:
        opts.user_key = _exit_on_file_read_failure(opts.user_key)
    if opts.user_certificate:
        opts.user_certificate = _exit_on_file_read_failure(opts.user_certificate)
    if opts.create:
        (_, errors) = self.rest.create_analytics_link(opts)
        _exit_if_errors(errors)
        _success('Link created')
    else:
        (_, errors) = self.rest.edit_analytics_link(opts)
        _exit_if_errors(errors)
        _success('Link edited')