# Extended data-plane manifest tests covering shapes beyond the basic
# KeyVault case: multiple resource types, top-level aliases, nested
# objects, array aliases, and schemaVersions.

data_manifest_json: |
  {
    "dataNamespace": "Microsoft.DataFactory.Data",
    "aliases": [
      {
        "name": "Microsoft.DataFactory.Data/factories/pipelines/enabled",
        "paths": [
          {
            "path": "enabled",
            "apiVersions": ["2018-06-01"]
          }
        ]
      }
    ],
    "resourceTypeAliases": [
      {
        "resourceType": "factories/pipelines",
        "aliases": [
          {
            "name": "Microsoft.DataFactory.Data/factories/pipelines/activities[*].type",
            "paths": [
              {
                "path": "activities[*].type",
                "apiVersions": ["2018-06-01"]
              }
            ]
          },
          {
            "name": "Microsoft.DataFactory.Data/factories/pipelines/activities[*].name",
            "paths": [
              {
                "path": "activities[*].name",
                "apiVersions": ["2018-06-01"]
              }
            ]
          },
          {
            "name": "Microsoft.DataFactory.Data/factories/pipelines/concurrency",
            "paths": [
              {
                "path": "concurrency",
                "apiVersions": ["2018-06-01"]
              }
            ]
          },
          {
            "name": "Microsoft.DataFactory.Data/factories/pipelines/folder.name",
            "paths": [
              {
                "path": "folder.name",
                "apiVersions": ["2018-06-01"]
              }
            ]
          }
        ]
      },
      {
        "resourceType": "factories/datasets",
        "aliases": [
          {
            "name": "Microsoft.DataFactory.Data/factories/datasets/linkedServiceName.referenceName",
            "paths": [
              {
                "path": "linkedServiceName.referenceName",
                "schemaVersions": ["1"]
              }
            ]
          },
          {
            "name": "Microsoft.DataFactory.Data/factories/datasets/description",
            "paths": [
              {
                "path": "description",
                "schemaVersions": ["1"]
              }
            ]
          }
        ]
      }
    ]
  }

cases:
  - note: data-plane pipeline with top-level alias and scalar fields
    use_registry_api: true
    input:
      type: "Microsoft.DataFactory.Data/factories/pipelines"
      enabled: true
      concurrency: 5
      folder:
        name: "etl-jobs"
    expected_normalized:
      type: "Microsoft.DataFactory.Data/factories/pipelines"
      enabled: true
      concurrency: 5
      folder:
        name: "etl-jobs"
    round_trip: true

  - note: data-plane pipeline with array alias
    use_registry_api: true
    input:
      type: "Microsoft.DataFactory.Data/factories/pipelines"
      activities:
        - name: CopyActivity1
          type: Copy
        - name: WaitActivity1
          type: Wait
    expected_normalized:
      type: "Microsoft.DataFactory.Data/factories/pipelines"
      activities:
        - name: CopyActivity1
          type: Copy
        - name: WaitActivity1
          type: Wait
    round_trip: true

  - note: data-plane dataset with nested alias path
    use_registry_api: true
    input:
      type: "Microsoft.DataFactory.Data/factories/datasets"
      description: "Sales data"
      linkedServiceName:
        referenceName: "AzureBlobStorage1"
        type: LinkedServiceReference
    expected_normalized:
      type: "Microsoft.DataFactory.Data/factories/datasets"
      description: "Sales data"
      linkedservicename:
        referencename: "AzureBlobStorage1"
        type: LinkedServiceReference
    round_trip: true
    expected_round_trip:
      type: "Microsoft.DataFactory.Data/factories/datasets"
      description: "Sales data"
      linkedServiceName:
        referenceName: "AzureBlobStorage1"
        type: LinkedServiceReference

  - note: data-plane without aliases (unknown resource type in namespace)
    use_registry_api: true
    input:
      type: "Microsoft.DataFactory.Data/factories/triggers"
      recurrence:
        frequency: Day
        interval: 1
    expected_normalized:
      type: "Microsoft.DataFactory.Data/factories/triggers"
      recurrence:
        frequency: Day
        interval: 1
    round_trip: true

  - note: data-plane denormalize dataset restores casing
    use_registry_api: true
    input:
      type: "Microsoft.DataFactory.Data/factories/datasets"
      description: "Sales data"
      linkedservicename:
        referencename: "AzureBlobStorage1"
    expected_denormalized:
      type: "Microsoft.DataFactory.Data/factories/datasets"
      description: "Sales data"
      linkedServiceName:
        referenceName: "AzureBlobStorage1"
    reverse_round_trip: true
