id: agaric_redirect
migration_group: agaric
label: Agaric Path Redirect
source:
  plugin: d7_path_redirect
  scheme: public
process:
  rid: rid
  uid:
    - plugin: migration_lookup
      migration: agaric_user
      source: uid
      no_stub: true
    - # If the user id does not exists then migrate it as anonymous.
      plugin: default_value
      default_value: 0
  redirect_source/path: source
  redirect_source/query:
    plugin: d7_redirect_source_query
    source: source_options
  redirect_redirect/uri:
    -
      plugin: migration_lookup_uri
      source:
       - redirect
       - redirect_options
    -
      plugin: d7_path_redirect
  language:
    plugin: default_value
    source: language
    default_value: und
  status_code:
    -
      plugin: static_map
      source: status_code
      map:
        0: 301
      bypass: TRUE
destination:
  plugin: entity:redirect
