swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: Use these REST APIs for performing retrieving a collection of policy snippets available in Azure API Management deployment.
  title: ApiManagementClient
  version: 2018-06-01-preview
  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/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2018-06-01-preview/apimpolicysnippets.json
      version: "2.0"
  x-preferred: false
  x-providerName: azure.com
  x-serviceName: apimanagement-apimpolicysnippets
  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
security:
  - azure_auth:
      - user_impersonation
parameters: {}
paths:
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policySnippets":
    get:
      description: Lists all policy snippets.
      operationId: PolicySnippets_ListByService
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Policy scope.
          enum:
            - Tenant
            - Product
            - Api
            - Operation
            - All
          in: query
          name: scope
          required: false
          type: string
          x-ms-enum:
            modelAsString: false
            name: PolicyScopeContract
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        "200":
          description: Returns an array of Policy Snippets.
          schema:
            description: The response of the list policy snippets operation.
            properties:
              value:
                description: Policy snippet value.
                items:
                  description: Policy snippet.
                  properties:
                    content:
                      description: Snippet content.
                      readOnly: true
                      type: string
                    name:
                      description: Snippet name.
                      readOnly: true
                      type: string
                    scope:
                      description: Binary OR value of the Snippet scope.
                      readOnly: true
                      type: integer
                    toolTip:
                      description: Snippet toolTip.
                      readOnly: true
                      type: string
                type: array
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - PolicySnippet
      x-ms-examples:
        ApiManagementListPolicySnippets:
          parameters:
            api-version: 2018-06-01-preview
            resourceGroupName: rg1
            scope: Api
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200":
              body:
                - content: <authentication-basic username="username" password="password" />
                  name: Authenticate with Basic
                  scope: 268435471
                  toolTip: Authenticate with the backend service using Basic authentication. Use in the inbound section at API scope.
definitions: {}
