# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/documentation/api-scenario/references/v1.2/schema.json
scope: ResourceGroup
variables:
  accountName:
    type: string
    prefix: accountn
  assetName:
    type: string
    prefix: assetnam
  liveEventName:
    type: string
    prefix: liveeven
  operationId:
    type: string
    prefix: operatio
  transformName:
    type: string
    prefix: transfor
  streamingEndpointName:
    type: string
    prefix: streamin
  filterName:
    type: string
    prefix: filterna
  trackName:
    type: string
    prefix: tracknam
  contentKeyPolicyName:
    type: string
    prefix: contentk
  jobName:
    type: string
    prefix: jobname
  streamingLocatorName:
    type: string
    prefix: streamin
  name:
    type: string
    prefix: name
  liveOutputName:
    type: string
    prefix: liveoutp
  locationName:
    type: string
    prefix: location
  streamingPolicyName:
    type: string
    prefix: streamin
  testStorageAccount:
    type: string
    prefix: teststorageaccount
prepareSteps:
  - step: CreateStorageAccount
    operationId: StorageAccounts_Create
    readmeTag: ../../../../../../../storage/resource-manager/readme.md
    parameters:
      accountName: $(testStorageAccount)
      parameters:
        kind: StorageV2
        location: $(location)
        sku:
          name: Standard_LRS
          tier: "Standard"
  - step: CreateAccount
    operationId: Mediaservices_CreateOrUpdate
    exampleFile: ../../../../Accounts/stable/2021-11-01/examples/async-accounts-create.json
    requestUpdate:
      - replace: /parameters/properties/storageAccounts/0/id
        value: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosorg/providers/Microsoft.Storage/storageAccounts/$(testStorageAccount)

scenarios:
  - scenario: GeneratedScenario
    steps:
      - operationId: LiveEvents_Create
        exampleFile: ../examples/liveevent-create.json
      - operationId: LiveEvents_List
        exampleFile: >-
          ../examples/liveevent-list-all.json
      - operationId: LiveEvents_Get
        exampleFile: >-
          ../examples/liveevent-list-by-name.json
      - operationId: LiveEvents_Allocate
        exampleFile: >-
          ../examples/liveevent-allocate.json
      - operationId: LiveEvents_Stop
        exampleFile: ../examples/liveevent-stop.json
      # disabling this test as it might take from 1 minutes to 30 minutes to complete
      # - operationId: LiveEvents_Reset
      #   exampleFile: ../examples/liveevent-reset.json
      # - operationId: LiveEvents_Start
      #   exampleFile: ../examples/liveevent-start.json
      - operationId: StreamingEndpoints_Create
        exampleFile: >-
          ../examples/streamingendpoint-create.json
      - operationId: StreamingEndpoints_Get
        exampleFile: >-
          ../examples/streamingendpoint-list-by-name.json
      - operationId: StreamingEndpoints_List
        exampleFile: >-
          ../examples/streamingendpoint-list-all.json
      - operationId: StreamingEndpoints_Skus
        exampleFile: >-
          ../examples/streamingendpoint-list-skus.json
      - operationId: StreamingEndpoints_Scale
        exampleFile: >-
          ../examples/streamingendpoint-scale.json
      - operationId: StreamingEndpoints_Stop
        exampleFile: >-
          ../examples/streamingendpoint-stop.json
      # disabling this test as it might take from 1 minutes to 30 minutes to complete
      # - operationId: StreamingEndpoints_Start
      #   exampleFile: >-
      #     ../examples/streamingendpoint-start.json
      - operationId: Assets_CreateOrUpdate
        exampleFile: ../../../../Metadata/stable/2022-08-01/examples/assets-create.json
        requestUpdate:
          - replace: /parameters/properties/storageAccountName
            value: $(testStorageAccount)
      - operationId: LiveOutputs_Create
        exampleFile: >-
          ../examples/liveoutput-create.json
        requestUpdate:
          - replace: /parameters/properties/assetName
            value: $(assetName)
      - operationId: LiveOutputs_List
        exampleFile: >-
          ../examples/liveoutput-list-all.json
      - operationId: LiveOutputs_Get
        exampleFile: >-
          ../examples/liveoutput-list-by-name.json
      - operationId: LiveOutputs_Delete
        exampleFile: >-
          ../examples/liveoutput-delete.json
      - operationId: StreamingEndpoints_Delete
        exampleFile: >-
          ../examples/streamingendpoint-delete.json
      - operationId: LiveEvents_Delete
        exampleFile: ../examples/liveevent-delete.json
