swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: This Swagger was generated by the API Framework.
  title: Azure Media Services
  version: 2018-07-01
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/mediaservices/resource-manager/Microsoft.Media/preview/2019-05-01-preview/AccountFilters.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: mediaservices-AccountFilters
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow
    flow: implicit
    scopes:
      user_impersonation: Impersonate your user account
    type: oauth2
parameters:
  ApiVersion:
    description: The Version of the API to be used with the client request.
    in: query
    name: api-version
    required: true
    type: string
  MediaServicesAccountName:
    description: The Media Services account name.
    in: path
    name: accountName
    required: true
    type: string
    x-ms-parameter-location: method
  ResourceGroupName:
    description: The name of the resource group within the Azure subscription.
    in: path
    name: resourceGroupName
    required: true
    type: string
    x-ms-parameter-location: method
  SubscriptionId:
    description: The unique identifier for a Microsoft Azure subscription.
    in: path
    name: subscriptionId
    required: true
    type: string
paths:
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/accountFilters":
    get:
      description: List Account Filters in the Media Services account.
      operationId: AccountFilters_List
      parameters:
        - $ref: "#/parameters/SubscriptionId"
        - $ref: "#/parameters/ResourceGroupName"
        - $ref: "#/parameters/MediaServicesAccountName"
        - $ref: "#/parameters/ApiVersion"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/AccountFilterCollection"
        default:
          description: Detailed error information.
          schema:
            $ref: "#/definitions/ApiError"
      summary: List Account Filters
      x-ms-examples:
        List all Account Filters:
          parameters:
            accountName: contosomedia
            api-version: 2018-07-01
            resourceGroupName: contoso
            subscriptionId: 00000000-0000-0000-0000-000000000000
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaservices/contosomedia/accountFilters/accountFilterWithTimeWindowAndTrack
                    name: accountFilterWithTimeWindowAndTrack
                    properties:
                      firstQuality:
                        bitrate: 128000
                      presentationTimeRange:
                        endTimestamp: 170000000
                        forceEndTimestamp: false
                        liveBackoffDuration: 0
                        presentationWindowDuration: 900000000000
                        startTimestamp: 0
                        timescale: 10000000
                      tracks:
                        - trackSelections:
                            - operation: Equal
                              property: Type
                              value: Audio
                            - operation: NotEqual
                              property: Language
                              value: en
                            - operation: NotEqual
                              property: FourCC
                              value: EC-3
                        - trackSelections:
                            - operation: Equal
                              property: Type
                              value: Video
                            - operation: Equal
                              property: Bitrate
                              value: 3000000-5000000
                    type: Microsoft.Media/mediaservices/accountFilters
                  - id: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaservices/contosomedia/accountFilters/accountFilterWithTrack
                    name: accountFilterWithTrack
                    properties:
                      tracks:
                        - trackSelections:
                            - operation: Equal
                              property: Type
                              value: Audio
                            - operation: NotEqual
                              property: Language
                              value: en
                            - operation: NotEqual
                              property: FourCC
                              value: EC-3
                        - trackSelections:
                            - operation: Equal
                              property: Type
                              value: Video
                            - operation: Equal
                              property: Bitrate
                              value: 3000000-5000000
                    type: Microsoft.Media/mediaservices/accountFilters
      x-ms-pageable:
        nextLinkName: "@odata.nextLink"
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/accountFilters/{filterName}":
    delete:
      description: Deletes an Account Filter in the Media Services account.
      operationId: AccountFilters_Delete
      parameters:
        - $ref: "#/parameters/SubscriptionId"
        - $ref: "#/parameters/ResourceGroupName"
        - $ref: "#/parameters/MediaServicesAccountName"
        - description: The Account Filter name
          in: path
          name: filterName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersion"
      responses:
        "200":
          description: OK
        "204":
          description: NoContent
        default:
          description: Detailed error information.
          schema:
            $ref: "#/definitions/ApiError"
      summary: Delete an Account Filter.
      x-ms-examples:
        Delete an Account Filter:
          parameters:
            accountName: contosomedia
            api-version: 2018-07-01
            filterName: accountFilterWithTimeWindowAndTrack
            resourceGroupName: contoso
            subscriptionId: 00000000-0000-0000-0000-000000000000
          responses:
            "200": {}
            "204": {}
    get:
      description: Get the details of an Account Filter in the Media Services account.
      operationId: AccountFilters_Get
      parameters:
        - $ref: "#/parameters/SubscriptionId"
        - $ref: "#/parameters/ResourceGroupName"
        - $ref: "#/parameters/MediaServicesAccountName"
        - description: The Account Filter name
          in: path
          name: filterName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersion"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/AccountFilter"
        "404":
          description: NotFound
        default:
          description: Detailed error information.
          schema:
            $ref: "#/definitions/ApiError"
      summary: Get an Account Filter.
      x-ms-examples:
        Get an Account Filter by name:
          parameters:
            accountName: contosomedia
            api-version: 2018-07-01
            filterName: accountFilterWithTrack
            resourceGroupName: contoso
            subscriptionId: 00000000-0000-0000-0000-000000000000
          responses:
            "200":
              body:
                id: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaservices/contosomedia/accountFilters/accountFilterWithTrack
                name: accountFilterWithTrack
                properties:
                  tracks:
                    - trackSelections:
                        - operation: Equal
                          property: Type
                          value: Audio
                        - operation: NotEqual
                          property: Language
                          value: en
                        - operation: NotEqual
                          property: FourCC
                          value: EC-3
                    - trackSelections:
                        - operation: Equal
                          property: Type
                          value: Video
                        - operation: Equal
                          property: Bitrate
                          value: 3000000-5000000
                type: Microsoft.Media/mediaservices/accountFilters
            "404": {}
    patch:
      description: Updates an existing Account Filter in the Media Services account.
      operationId: AccountFilters_Update
      parameters:
        - $ref: "#/parameters/SubscriptionId"
        - $ref: "#/parameters/ResourceGroupName"
        - $ref: "#/parameters/MediaServicesAccountName"
        - description: The Account Filter name
          in: path
          name: filterName
          required: true
          type: string
        - description: The request parameters
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/AccountFilter"
        - $ref: "#/parameters/ApiVersion"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/AccountFilter"
        default:
          description: Detailed error information.
          schema:
            $ref: "#/definitions/ApiError"
      summary: Update an Account Filter
      x-ms-examples:
        Update an Account Filter:
          parameters:
            accountName: contosomedia
            api-version: 2018-07-01
            filterName: accountFilterWithTimeWindowAndTrack
            parameters:
              properties:
                firstQuality:
                  bitrate: 128000
                presentationTimeRange:
                  endTimestamp: 170000000
                  forceEndTimestamp: false
                  liveBackoffDuration: 0
                  presentationWindowDuration: 900000000000
                  startTimestamp: 10
                  timescale: 10000000
            resourceGroupName: contoso
            subscriptionId: 00000000-0000-0000-0000-000000000000
          responses:
            "200":
              body:
                id: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaservices/contosomedia/accountFilters/accountFilterWithTimeWindowAndTrack
                name: accountFilterWithTimeWindowAndTrack
                properties:
                  firstQuality:
                    bitrate: 128000
                  presentationTimeRange:
                    endTimestamp: 170000000
                    forceEndTimestamp: false
                    liveBackoffDuration: 0
                    presentationWindowDuration: 900000000000
                    startTimestamp: 10
                    timescale: 10000000
                  tracks:
                    - trackSelections:
                        - operation: Equal
                          property: Type
                          value: Audio
                        - operation: NotEqual
                          property: Language
                          value: en
                        - operation: NotEqual
                          property: FourCC
                          value: EC-3
                    - trackSelections:
                        - operation: Equal
                          property: Type
                          value: Video
                        - operation: Equal
                          property: Bitrate
                          value: 3000000-5000000
                type: Microsoft.Media/mediaservices/accountFilters
    put:
      description: Creates or updates an Account Filter in the Media Services account.
      operationId: AccountFilters_CreateOrUpdate
      parameters:
        - $ref: "#/parameters/SubscriptionId"
        - $ref: "#/parameters/ResourceGroupName"
        - $ref: "#/parameters/MediaServicesAccountName"
        - description: The Account Filter name
          in: path
          name: filterName
          required: true
          type: string
        - description: The request parameters
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/AccountFilter"
        - $ref: "#/parameters/ApiVersion"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/AccountFilter"
        "201":
          description: Created
          schema:
            $ref: "#/definitions/AccountFilter"
        default:
          description: Detailed error information.
          schema:
            $ref: "#/definitions/ApiError"
      summary: Create or update an Account Filter
      x-ms-examples:
        Create an Account Filter:
          parameters:
            accountName: contosomedia
            api-version: 2018-07-01
            filterName: newAccountFilter
            parameters:
              properties:
                firstQuality:
                  bitrate: 128000
                presentationTimeRange:
                  endTimestamp: 170000000
                  forceEndTimestamp: false
                  liveBackoffDuration: 0
                  presentationWindowDuration: 900000000000
                  startTimestamp: 0
                  timescale: 10000000
                tracks:
                  - trackSelections:
                      - operation: Equal
                        property: Type
                        value: Audio
                      - operation: NotEqual
                        property: Language
                        value: en
                      - operation: NotEqual
                        property: FourCC
                        value: EC-3
                  - trackSelections:
                      - operation: Equal
                        property: Type
                        value: Video
                      - operation: Equal
                        property: Bitrate
                        value: 3000000-5000000
            resourceGroupName: contoso
            subscriptionId: 00000000-0000-0000-0000-000000000000
          responses:
            "200":
              body:
                id: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaservices/contosomedia/accountFilters/newAccountFilter
                name: newAccountFilter
                properties:
                  firstQuality:
                    bitrate: 128000
                  presentationTimeRange:
                    endTimestamp: 170000000
                    forceEndTimestamp: false
                    liveBackoffDuration: 0
                    presentationWindowDuration: 900000000000
                    startTimestamp: 0
                    timescale: 10000000
                  tracks:
                    - trackSelections:
                        - operation: Equal
                          property: Type
                          value: Audio
                        - operation: NotEqual
                          property: Language
                          value: en
                        - operation: NotEqual
                          property: FourCC
                          value: EC-3
                    - trackSelections:
                        - operation: Equal
                          property: Type
                          value: Video
                        - operation: Equal
                          property: Bitrate
                          value: 3000000-5000000
                type: Microsoft.Media/mediaservices/accountFilters
            "201":
              body:
                id: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaservices/contosomedia/accountFilters/newAccountFilter
                name: newAccountFilter
                properties:
                  firstQuality:
                    bitrate: 128000
                  presentationTimeRange:
                    endTimestamp: 170000000
                    forceEndTimestamp: false
                    liveBackoffDuration: 0
                    presentationWindowDuration: 900000000000
                    startTimestamp: 0
                    timescale: 10000000
                  tracks:
                    - trackSelections:
                        - operation: Equal
                          property: Type
                          value: Audio
                        - operation: NotEqual
                          property: Language
                          value: en
                        - operation: NotEqual
                          property: FourCC
                          value: EC-3
                    - trackSelections:
                        - operation: Equal
                          property: Type
                          value: Video
                        - operation: Equal
                          property: Bitrate
                          value: 3000000-5000000
                type: Microsoft.Media/mediaservices/accountFilters
definitions:
  AccountFilter:
    allOf:
      - allOf:
          - description: The core properties of ARM resources.
            properties:
              id:
                description: Fully qualified resource ID for the resource.
                readOnly: true
                type: string
              name:
                description: The name of the resource.
                readOnly: true
                type: string
              type:
                description: The type of the resource.
                readOnly: true
                type: string
            x-ms-azure-resource: true
        description: The resource model definition for a ARM proxy resource.
    description: An Account Filter.
    properties:
      properties:
        $ref: "#/definitions/MediaFilterProperties"
        x-ms-client-flatten: true
    type: object
  AccountFilterCollection:
    description: A collection of AccountFilter items.
    properties:
      "@odata.nextLink":
        description: A link to the next page of the collection (when the collection contains too many results to return in one response).
        type: string
      value:
        description: A collection of AccountFilter items.
        items:
          $ref: "#/definitions/AccountFilter"
        type: array
    type: object
  ApiError:
    description: The API error.
    properties:
      error:
        $ref: "#/definitions/ODataError"
        description: The error properties.
    type: object
  FilterTrackPropertyCondition:
    description: The class to specify one track property condition.
    properties:
      operation:
        description: The track property condition operation.
        enum:
          - Equal
          - NotEqual
        type: string
        x-ms-enum:
          modelAsString: true
          name: FilterTrackPropertyCompareOperation
          values:
            - description: The equal operation.
              value: Equal
            - description: The not equal operation.
              value: NotEqual
      property:
        description: The track property type.
        enum:
          - Unknown
          - Type
          - Name
          - Language
          - FourCC
          - Bitrate
        type: string
        x-ms-enum:
          modelAsString: true
          name: FilterTrackPropertyType
          values:
            - description: The unknown track property type.
              value: Unknown
            - description: The type.
              value: Type
            - description: The name.
              value: Name
            - description: The language.
              value: Language
            - description: The fourCC.
              value: FourCC
            - description: The bitrate.
              value: Bitrate
      value:
        description: The track property value.
        type: string
    required:
      - property
      - value
      - operation
    type: object
  FilterTrackSelection:
    description: Representing a list of FilterTrackPropertyConditions to select a track.  The filters are combined using a logical AND operation.
    properties:
      trackSelections:
        description: The track selections.
        items:
          $ref: "#/definitions/FilterTrackPropertyCondition"
        type: array
    required:
      - trackSelections
    type: object
  FirstQuality:
    description: Filter First Quality
    properties:
      bitrate:
        description: The first quality bitrate.
        format: int32
        type: integer
    required:
      - bitrate
    type: object
  MediaFilterProperties:
    description: The Media Filter properties.
    properties:
      firstQuality:
        $ref: "#/definitions/FirstQuality"
        description: The first quality.
      presentationTimeRange:
        $ref: "#/definitions/PresentationTimeRange"
        description: The presentation time range.
      tracks:
        description: The tracks selection conditions.
        items:
          $ref: "#/definitions/FilterTrackSelection"
        type: array
    type: object
  ODataError:
    description: Information about an error.
    properties:
      code:
        description: A language-independent error name.
        type: string
      details:
        description: The error details.
        items:
          $ref: "#/definitions/ODataError"
        type: array
      message:
        description: The error message.
        type: string
      target:
        description: The target of the error (for example, the name of the property in error).
        type: string
    type: object
  PresentationTimeRange:
    description: The presentation time range, this is asset related and not recommended for Account Filter.
    properties:
      endTimestamp:
        description: The absolute end time boundary.
        format: int64
        type: integer
      forceEndTimestamp:
        description: The indicator of forcing existing of end time stamp.
        type: boolean
      liveBackoffDuration:
        description: The relative to end right edge.
        format: int64
        type: integer
      presentationWindowDuration:
        description: The relative to end sliding window.
        format: int64
        type: integer
      startTimestamp:
        description: The absolute start time boundary.
        format: int64
        type: integer
      timescale:
        description: The time scale of time stamps.
        format: int64
        type: integer
    type: object
