# 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
  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"
scenarios:
  - scenario: AccountTests
    steps:
      - operationId: Locations_CheckNameAvailability
        exampleFile: >-
          ../examples/accounts-check-name-availability.json
        requestUpdate:
          - replace: /parameters/name
            value: $(accountName)
      - operationId: Mediaservices_CreateOrUpdate
        exampleFile: >-
          ../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)
      - operationId: Mediaservices_ListBySubscription
        exampleFile: >-
          ../examples/accounts-subscription-list-all-accounts.json
      - operationId: Mediaservices_Get
        exampleFile: >-
          ../examples/accounts-get-by-name.json
      - operationId: Mediaservices_List
        exampleFile: >-
          ../examples/accounts-list-all-accounts.json
      - operationId: Mediaservices_Update
        exampleFile: >-
          ../examples/async-accounts-update.json
      - operationId: Mediaservices_SyncStorageKeys
        exampleFile: >-
          ../examples/accounts-sync-storage-keys.json
        requestUpdate:
          - replace: /parameters/id
            value: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosorg/providers/Microsoft.Storage/storageAccounts/$(testStorageAccount)
      - operationId: Operations_List
        exampleFile: >-
          ../examples/operations-list-all.json
      - operationId: Mediaservices_Delete
        exampleFile: ../examples/accounts-delete.json
