{
  "swagger": "2.0",
  "schemes": [
    "https"
  ],
  "host": "management.azure.com",
  "info": {
    "description": "To manage and control access to your resources, you can define customized policies and assign them at a scope.",
    "title": "PolicyClient",
    "version": "2017-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/resources/resource-manager/Microsoft.Authorization/preview/2017-06-01-preview/policySetDefinitions.json",
        "version": "2.0"
      }
    ],
    "x-preferred": false,
    "x-providerName": "azure.com",
    "x-serviceName": "resources-policySetDefinitions",
    "x-tags": [
      "Azure",
      "Microsoft"
    ]
  },
  "consumes": [
    "application/json",
    "text/json"
  ],
  "produces": [
    "application/json",
    "text/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": {
    "ApiVersionParameter": {
      "description": "The API version to use for the operation.",
      "in": "query",
      "name": "api-version",
      "required": true,
      "type": "string"
    },
    "ManagementGroupIdParameter": {
      "description": "The ID of the management group.",
      "in": "path",
      "name": "managementGroupId",
      "required": true,
      "type": "string",
      "x-ms-parameter-location": "method"
    },
    "SubscriptionIdParameter": {
      "description": "The ID of the target subscription.",
      "in": "path",
      "name": "subscriptionId",
      "required": true,
      "type": "string"
    }
  },
  "paths": {
    "/providers/Microsoft.Authorization/policySetDefinitions": {
      "get": {
        "description": "Gets all the built in policy set definitions.",
        "operationId": "PolicySetDefinitions_ListBuiltIn",
        "parameters": [
          {
            "$ref": "#/parameters/ApiVersionParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "OK - Returns an array of built in policy set definitions.",
            "schema": {
              "$ref": "#/definitions/PolicySetDefinitionListResult"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "tags": [
          "PolicySetDefinitions"
        ],
        "x-ms-examples": {
          "List policy set definitions": {
            "parameters": {
              "api-version": "2017-06-01-preview"
            },
            "responses": {
              "200": {
                "body": {
                  "value": [
                    {
                      "id": "/providers/Microsoft.Authorization/policySetDefinitions/costManagement",
                      "name": "costManagement",
                      "properties": {
                        "description": "Policies required to minimize the risk of accidental cost overruns",
                        "displayName": "VM and Storage Cost Management",
                        "metadata": {
                          "category": "Cost Management"
                        },
                        "parameters": {
                          "allowedLocations": {
                            "metadata": {
                              "description": "Regions that resources can be deployed to",
                              "displayName": "Valid Regions"
                            },
                            "type": "array"
                          }
                        },
                        "policyDefinitions": [
                          {
                            "parameters": {
                              "locations": {
                                "value": "[parameters('allowedLocations')]"
                              }
                            },
                            "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/storageSkus"
                          }
                        ],
                        "policyType": "Custom"
                      },
                      "type": "Microsoft.Authorization/policySetDefinitions"
                    },
                    {
                      "id": "/providers/Microsoft.Authorization/policySetDefinitions/skuManagement",
                      "name": "skuManagement",
                      "properties": {
                        "description": "Policies required to minimize the risk of accidental cost overruns",
                        "displayName": "VM Sku Management",
                        "metadata": {
                          "category": "Sku Management"
                        },
                        "policyDefinitions": [
                          {
                            "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/vmSkus"
                          }
                        ],
                        "policyType": "Custom"
                      },
                      "type": "Microsoft.Authorization/policySetDefinitions"
                    }
                  ]
                },
                "headers": {}
              }
            }
          }
        },
        "x-ms-pageable": {
          "nextLinkName": "nextLink"
        }
      }
    },
    "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}": {
      "get": {
        "description": "Gets the built in policy set definition.",
        "operationId": "PolicySetDefinitions_GetBuiltIn",
        "parameters": [
          {
            "description": "The name of the policy set definition to get.",
            "in": "path",
            "name": "policySetDefinitionName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/ApiVersionParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "OK - Returns information about the built in policy set definition.",
            "schema": {
              "$ref": "#/definitions/PolicySetDefinition"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "tags": [
          "PolicySetDefinitions"
        ],
        "x-ms-examples": {
          "Get a built in policy set definition": {
            "parameters": {
              "api-version": "2017-06-01-preview",
              "policySetDefinitionName": "costManagement"
            },
            "responses": {
              "200": {
                "body": {
                  "id": "/providers/Microsoft.Authorization/policySetDefinitions/costManagement",
                  "name": "costManagement",
                  "properties": {
                    "description": "Policies required to minimize the risk of accidental cost overruns",
                    "displayName": "VM and Storage Cost Management",
                    "metadata": {
                      "category": "Cost Management"
                    },
                    "parameters": {
                      "allowedLocations": {
                        "metadata": {
                          "description": "Regions that resources can be deployed to",
                          "displayName": "Valid Regions"
                        },
                        "type": "array"
                      }
                    },
                    "policyDefinitions": [
                      {
                        "parameters": {
                          "listOfAllowedSKUs": {
                            "value": [
                              "Standard_GRS",
                              "Standard_LRS"
                            ]
                          }
                        },
                        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/storageSkus"
                      },
                      {
                        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/vmSkus"
                      },
                      {
                        "parameters": {
                          "listOfAllowedLocations": {
                            "value": "[parameters('allowedLocations')]"
                          }
                        },
                        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/policyDefinitionId"
                      }
                    ],
                    "policyType": "Custom"
                  },
                  "type": "Microsoft.Authorization/policySetDefinitions"
                },
                "headers": {}
              }
            }
          }
        }
      }
    },
    "/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions": {
      "get": {
        "description": "Gets all the policy set definitions for a subscription at management group.",
        "operationId": "PolicySetDefinitions_ListByManagementGroup",
        "parameters": [
          {
            "$ref": "#/parameters/ApiVersionParameter"
          },
          {
            "$ref": "#/parameters/ManagementGroupIdParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "OK - Returns an array of policy set definitions.",
            "schema": {
              "$ref": "#/definitions/PolicySetDefinitionListResult"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "tags": [
          "PolicySetDefinitions"
        ],
        "x-ms-examples": {
          "List policy set definitions": {
            "parameters": {
              "api-version": "2017-06-01-preview",
              "managementGroupId": "mgid",
              "subscriptionId": "subid"
            },
            "responses": {
              "200": {
                "body": {
                  "value": [
                    {
                      "id": "/providers/Microsoft.Management/managementgroups/mgid/providers/Microsoft.Authorization/policySetDefinitions/costManagement",
                      "name": "costManagement",
                      "properties": {
                        "description": "Policies required to minimize the risk of accidental cost overruns",
                        "displayName": "VM and Storage Cost Management",
                        "metadata": {
                          "category": "Cost Management"
                        },
                        "parameters": {
                          "allowedLocations": {
                            "metadata": {
                              "description": "Regions that resources can be deployed to",
                              "displayName": "Valid Regions"
                            },
                            "type": "array"
                          }
                        },
                        "policyDefinitions": [
                          {
                            "parameters": {
                              "locations": {
                                "value": "[parameters('allowedLocations')]"
                              }
                            },
                            "policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/storageSkus"
                          }
                        ],
                        "policyType": "Custom"
                      },
                      "type": "Microsoft.Authorization/policySetDefinitions"
                    },
                    {
                      "id": "/providers/Microsoft.Management/managementgroups/mgid/providers/Microsoft.Authorization/policySetDefinitions/skuManagement",
                      "name": "skuManagement",
                      "properties": {
                        "description": "Policies required to minimize the risk of accidental cost overruns",
                        "displayName": "VM Sku Management",
                        "metadata": {
                          "category": "Sku Management"
                        },
                        "policyDefinitions": [
                          {
                            "policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/vmSkus"
                          }
                        ],
                        "policyType": "Custom"
                      },
                      "type": "Microsoft.Authorization/policySetDefinitions"
                    }
                  ]
                },
                "headers": {}
              }
            }
          }
        },
        "x-ms-pageable": {
          "nextLinkName": "nextLink"
        }
      }
    },
    "/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}": {
      "delete": {
        "description": "Deletes a policy set definition at management group level.",
        "operationId": "PolicySetDefinitions_DeleteAtManagementGroup",
        "parameters": [
          {
            "description": "The name of the policy set definition to delete.",
            "in": "path",
            "name": "policySetDefinitionName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/ApiVersionParameter"
          },
          {
            "$ref": "#/parameters/ManagementGroupIdParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "204": {
            "description": "No Content - the policy set definition doesn't exist in the subscription."
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "tags": [
          "PolicySetDefinitions"
        ]
      },
      "get": {
        "description": "Gets the policy set definition at management group level.",
        "operationId": "PolicySetDefinitions_GetAtManagementGroup",
        "parameters": [
          {
            "description": "The name of the policy set definition to get.",
            "in": "path",
            "name": "policySetDefinitionName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/ApiVersionParameter"
          },
          {
            "$ref": "#/parameters/ManagementGroupIdParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "OK - Returns information about the policy set definition.",
            "schema": {
              "$ref": "#/definitions/PolicySetDefinition"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "tags": [
          "PolicySetDefinitions"
        ],
        "x-ms-examples": {
          "Get a policy set definition": {
            "parameters": {
              "api-version": "2017-06-01-preview",
              "managementGroupId": "mgid",
              "policySetDefinitionName": "costManagement",
              "subscriptionId": "subid"
            },
            "responses": {
              "200": {
                "body": {
                  "id": "/providers/Microsoft.Management/managementgroups/mgid/providers/Microsoft.Authorization/policySetDefinitions/costManagement",
                  "name": "costManagement",
                  "properties": {
                    "description": "Policies required to minimize the risk of accidental cost overruns",
                    "displayName": "VM and Storage Cost Management",
                    "metadata": {
                      "category": "Cost Management"
                    },
                    "parameters": {
                      "allowedLocations": {
                        "metadata": {
                          "description": "Regions that resources can be deployed to",
                          "displayName": "Valid Regions"
                        },
                        "type": "array"
                      }
                    },
                    "policyDefinitions": [
                      {
                        "parameters": {
                          "listOfAllowedSKUs": {
                            "value": [
                              "Standard_GRS",
                              "Standard_LRS"
                            ]
                          }
                        },
                        "policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/storageSkus"
                      },
                      {
                        "policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/vmSkus"
                      },
                      {
                        "parameters": {
                          "listOfAllowedLocations": {
                            "value": "[parameters('allowedLocations')]"
                          }
                        },
                        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/policyDefinitionId"
                      }
                    ],
                    "policyType": "Custom"
                  },
                  "type": "Microsoft.Authorization/policySetDefinitions"
                },
                "headers": {}
              }
            }
          }
        }
      },
      "put": {
        "description": "Creates or updates a policy set definition at management group level.",
        "operationId": "PolicySetDefinitions_CreateOrUpdateAtManagementGroup",
        "parameters": [
          {
            "description": "The name of the policy set definition to create.",
            "in": "path",
            "name": "policySetDefinitionName",
            "required": true,
            "type": "string"
          },
          {
            "description": "The policy set definition properties.",
            "in": "body",
            "name": "parameters",
            "required": true,
            "schema": {
              "$ref": "#/definitions/PolicySetDefinition"
            }
          },
          {
            "$ref": "#/parameters/ApiVersionParameter"
          },
          {
            "$ref": "#/parameters/ManagementGroupIdParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "OK - Returns information about the policy set definition.",
            "schema": {
              "$ref": "#/definitions/PolicySetDefinition"
            }
          },
          "201": {
            "description": "Created - Returns information about the policy set definition.",
            "schema": {
              "$ref": "#/definitions/PolicySetDefinition"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "tags": [
          "PolicySetDefinitions"
        ],
        "x-ms-examples": {
          "Put a policy set definition": {
            "parameters": {
              "api-version": "2017-06-01-preview",
              "managementGroupId": "mgid",
              "parameters": {
                "properties": {
                  "description": "Policies required to minimize the risk of accidental cost overruns",
                  "displayName": "VM and Storage Cost Management",
                  "metadata": {
                    "category": "Cost Management"
                  },
                  "policyDefinitions": [
                    {
                      "parameters": {
                        "listOfAllowedSKUs": {
                          "value": [
                            "Standard_GRS",
                            "Standard_LRS"
                          ]
                        }
                      },
                      "policyDefinitionId": "/subscriptions/subId/providers/Microsoft.Authorization/policyDefinitions/storageSkus"
                    }
                  ]
                }
              },
              "policySetDefinitionName": "costManagement",
              "subscriptionId": "subid"
            },
            "responses": {
              "200": {
                "body": {
                  "id": "/providers/Microsoft.Management/managementgroups/mgid/providers/Microsoft.Authorization/policySetDefinitions/costManagement",
                  "name": "costManagement",
                  "properties": {
                    "description": "Policies required to minimize the risk of accidental cost overruns",
                    "displayName": "VM and Storage Cost Management",
                    "metadata": {
                      "category": "Cost Management"
                    },
                    "policyDefinitions": [
                      {
                        "parameters": {
                          "listOfAllowedSKUs": {
                            "value": [
                              "Standard_GRS",
                              "Standard_LRS"
                            ]
                          }
                        },
                        "policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/storageSkus"
                      }
                    ],
                    "policyType": "Custom"
                  },
                  "type": "Microsoft.Authorization/policySetDefinitions"
                },
                "headers": {}
              },
              "201": {
                "body": {
                  "id": "/providers/Microsoft.Management/managementgroups/mgid/providers/Microsoft.Authorization/policySetDefinitions/costManagement",
                  "name": "costManagement",
                  "properties": {
                    "description": "Policies required to minimize the risk of accidental cost overruns",
                    "displayName": "VM and Storage Cost Management",
                    "metadata": {
                      "category": "Cost Management"
                    },
                    "policyDefinitions": [
                      {
                        "parameters": {
                          "listOfAllowedSKUs": {
                            "value": [
                              "Standard_GRS",
                              "Standard_LRS"
                            ]
                          }
                        },
                        "policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/storageSkus"
                      }
                    ],
                    "policyType": "Custom"
                  },
                  "type": "Microsoft.Authorization/policySetDefinitions"
                },
                "headers": {}
              }
            }
          }
        }
      }
    },
    "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions": {
      "get": {
        "description": "Gets all the policy set definitions for a subscription.",
        "operationId": "PolicySetDefinitions_List",
        "parameters": [
          {
            "$ref": "#/parameters/ApiVersionParameter"
          },
          {
            "$ref": "#/parameters/SubscriptionIdParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "OK - Returns an array of policy set definitions.",
            "schema": {
              "$ref": "#/definitions/PolicySetDefinitionListResult"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "tags": [
          "PolicySetDefinitions"
        ],
        "x-ms-examples": {
          "List policy set definitions": {
            "parameters": {
              "api-version": "2017-06-01-preview",
              "subscriptionId": "subid"
            },
            "responses": {
              "200": {
                "body": {
                  "value": [
                    {
                      "id": "/subscriptions/subid/providers/Microsoft.Authorization/policySetDefinitions/costManagement",
                      "name": "costManagement",
                      "properties": {
                        "description": "Policies required to minimize the risk of accidental cost overruns",
                        "displayName": "VM and Storage Cost Management",
                        "metadata": {
                          "category": "Cost Management"
                        },
                        "parameters": {
                          "allowedLocations": {
                            "metadata": {
                              "description": "Regions that resources can be deployed to",
                              "displayName": "Valid Regions"
                            },
                            "type": "array"
                          }
                        },
                        "policyDefinitions": [
                          {
                            "parameters": {
                              "locations": {
                                "value": "[parameters('allowedLocations')]"
                              }
                            },
                            "policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/storageSkus"
                          }
                        ],
                        "policyType": "Custom"
                      },
                      "type": "Microsoft.Authorization/policySetDefinitions"
                    },
                    {
                      "id": "/subscriptions/subid/providers/Microsoft.Authorization/policySetDefinitions/skuManagement",
                      "name": "skuManagement",
                      "properties": {
                        "description": "Policies required to minimize the risk of accidental cost overruns",
                        "displayName": "VM Sku Management",
                        "metadata": {
                          "category": "Sku Management"
                        },
                        "policyDefinitions": [
                          {
                            "policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/vmSkus"
                          }
                        ],
                        "policyType": "Custom"
                      },
                      "type": "Microsoft.Authorization/policySetDefinitions"
                    }
                  ]
                },
                "headers": {}
              }
            }
          }
        },
        "x-ms-pageable": {
          "nextLinkName": "nextLink"
        }
      }
    },
    "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}": {
      "delete": {
        "description": "Deletes a policy set definition.",
        "operationId": "PolicySetDefinitions_Delete",
        "parameters": [
          {
            "description": "The name of the policy set definition to delete.",
            "in": "path",
            "name": "policySetDefinitionName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/ApiVersionParameter"
          },
          {
            "$ref": "#/parameters/SubscriptionIdParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "204": {
            "description": "No Content - the policy set definition doesn't exist in the subscription."
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "tags": [
          "PolicySetDefinitions"
        ]
      },
      "get": {
        "description": "Gets the policy set definition.",
        "operationId": "PolicySetDefinitions_Get",
        "parameters": [
          {
            "description": "The name of the policy set definition to get.",
            "in": "path",
            "name": "policySetDefinitionName",
            "required": true,
            "type": "string"
          },
          {
            "$ref": "#/parameters/ApiVersionParameter"
          },
          {
            "$ref": "#/parameters/SubscriptionIdParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "OK - Returns information about the policy set definition.",
            "schema": {
              "$ref": "#/definitions/PolicySetDefinition"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "tags": [
          "PolicySetDefinitions"
        ],
        "x-ms-examples": {
          "Get a policy set definition": {
            "parameters": {
              "api-version": "2017-06-01-preview",
              "policySetDefinitionName": "costManagement",
              "subscriptionId": "subid"
            },
            "responses": {
              "200": {
                "body": {
                  "id": "/subscriptions/subid/providers/Microsoft.Authorization/policySetDefinitions/costManagement",
                  "name": "costManagement",
                  "properties": {
                    "description": "Policies required to minimize the risk of accidental cost overruns",
                    "displayName": "VM and Storage Cost Management",
                    "metadata": {
                      "category": "Cost Management"
                    },
                    "parameters": {
                      "allowedLocations": {
                        "metadata": {
                          "description": "Regions that resources can be deployed to",
                          "displayName": "Valid Regions"
                        },
                        "type": "array"
                      }
                    },
                    "policyDefinitions": [
                      {
                        "parameters": {
                          "listOfAllowedSKUs": {
                            "value": [
                              "Standard_GRS",
                              "Standard_LRS"
                            ]
                          }
                        },
                        "policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/storageSkus"
                      },
                      {
                        "policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/vmSkus"
                      },
                      {
                        "parameters": {
                          "listOfAllowedLocations": {
                            "value": "[parameters('allowedLocations')]"
                          }
                        },
                        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/policyDefinitionId"
                      }
                    ],
                    "policyType": "Custom"
                  },
                  "type": "Microsoft.Authorization/policySetDefinitions"
                },
                "headers": {}
              }
            }
          }
        }
      },
      "put": {
        "description": "Creates or updates a policy set definition.",
        "operationId": "PolicySetDefinitions_CreateOrUpdate",
        "parameters": [
          {
            "description": "The name of the policy set definition to create.",
            "in": "path",
            "name": "policySetDefinitionName",
            "required": true,
            "type": "string"
          },
          {
            "description": "The policy set definition properties.",
            "in": "body",
            "name": "parameters",
            "required": true,
            "schema": {
              "$ref": "#/definitions/PolicySetDefinition"
            }
          },
          {
            "$ref": "#/parameters/ApiVersionParameter"
          },
          {
            "$ref": "#/parameters/SubscriptionIdParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "OK - Returns information about the policy set definition.",
            "schema": {
              "$ref": "#/definitions/PolicySetDefinition"
            }
          },
          "201": {
            "description": "Created - Returns information about the policy set definition.",
            "schema": {
              "$ref": "#/definitions/PolicySetDefinition"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "tags": [
          "PolicySetDefinitions"
        ],
        "x-ms-examples": {
          "Put a policy set definition": {
            "parameters": {
              "api-version": "2017-06-01-preview",
              "parameters": {
                "properties": {
                  "description": "Policies required to minimize the risk of accidental cost overruns",
                  "displayName": "VM and Storage Cost Management",
                  "metadata": {
                    "category": "Cost Management"
                  },
                  "policyDefinitions": [
                    {
                      "parameters": {
                        "listOfAllowedSKUs": {
                          "value": [
                            "Standard_GRS",
                            "Standard_LRS"
                          ]
                        }
                      },
                      "policyDefinitionId": "/subscriptions/subId/providers/Microsoft.Authorization/policyDefinitions/storageSkus"
                    }
                  ]
                }
              },
              "policySetDefinitionName": "costManagement",
              "subscriptionId": "subid"
            },
            "responses": {
              "200": {
                "body": {
                  "id": "/subscriptions/subid/providers/Microsoft.Authorization/policySetDefinitions/costManagement",
                  "name": "costManagement",
                  "properties": {
                    "description": "Policies required to minimize the risk of accidental cost overruns",
                    "displayName": "VM and Storage Cost Management",
                    "metadata": {
                      "category": "Cost Management"
                    },
                    "policyDefinitions": [
                      {
                        "parameters": {
                          "listOfAllowedSKUs": {
                            "value": [
                              "Standard_GRS",
                              "Standard_LRS"
                            ]
                          }
                        },
                        "policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/storageSkus"
                      }
                    ],
                    "policyType": "Custom"
                  },
                  "type": "Microsoft.Authorization/policySetDefinitions"
                },
                "headers": {}
              },
              "201": {
                "body": {
                  "id": "/subscriptions/subid/providers/Microsoft.Authorization/policySetDefinitions/costManagement",
                  "name": "costManagement",
                  "properties": {
                    "description": "Policies required to minimize the risk of accidental cost overruns",
                    "displayName": "VM and Storage Cost Management",
                    "metadata": {
                      "category": "Cost Management"
                    },
                    "policyDefinitions": [
                      {
                        "parameters": {
                          "listOfAllowedSKUs": {
                            "value": [
                              "Standard_GRS",
                              "Standard_LRS"
                            ]
                          }
                        },
                        "policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/storageSkus"
                      }
                    ],
                    "policyType": "Custom"
                  },
                  "type": "Microsoft.Authorization/policySetDefinitions"
                },
                "headers": {}
              }
            }
          }
        }
      }
    }
  },
  "definitions": {
    "ErrorResponse": {
      "description": "Error response indicates ARM is not able to process the incoming request. The reason is provided in the error message.",
      "properties": {
        "errorCode": {
          "description": "Error code.",
          "type": "string"
        },
        "errorMessage": {
          "description": "Error message indicating why the operation failed.",
          "type": "string"
        },
        "httpStatus": {
          "description": "Http status code.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "PolicyDefinitionReference": {
      "description": "The policy definition reference.",
      "properties": {
        "parameters": {
          "description": "Required if a parameter is used in policy rule.",
          "type": "object"
        },
        "policyDefinitionId": {
          "description": "The ID of the policy definition or policy set definition.",
          "type": "string"
        }
      }
    },
    "PolicySetDefinition": {
      "description": "The policy set definition.",
      "properties": {
        "id": {
          "description": "The ID of the policy set definition.",
          "readOnly": true,
          "type": "string"
        },
        "name": {
          "description": "The name of the policy set definition.",
          "readOnly": true,
          "type": "string"
        },
        "properties": {
          "$ref": "#/definitions/PolicySetDefinitionProperties",
          "description": "The policy definition properties.",
          "x-ms-client-flatten": true
        },
        "type": {
          "description": "The type of the resource (Microsoft.Authorization/policySetDefinitions).",
          "readOnly": true,
          "type": "string"
        }
      },
      "x-ms-azure-resource": true
    },
    "PolicySetDefinitionListResult": {
      "description": "List of policy set definitions.",
      "properties": {
        "nextLink": {
          "description": "The URL to use for getting the next set of results.",
          "type": "string"
        },
        "value": {
          "description": "An array of policy set definitions.",
          "items": {
            "$ref": "#/definitions/PolicySetDefinition"
          },
          "type": "array"
        }
      }
    },
    "PolicySetDefinitionProperties": {
      "description": "The policy set definition properties.",
      "properties": {
        "description": {
          "description": "The policy set definition description.",
          "type": "string"
        },
        "displayName": {
          "description": "The display name of the policy set definition.",
          "type": "string"
        },
        "metadata": {
          "description": "The policy set definition metadata.",
          "type": "object"
        },
        "parameters": {
          "description": "The policy set definition parameters that can be used in policy definition references.",
          "type": "object"
        },
        "policyDefinitions": {
          "description": "An array of policy definition references.",
          "items": {
            "$ref": "#/definitions/PolicyDefinitionReference"
          },
          "type": "array"
        },
        "policyType": {
          "description": "The type of policy definition. Possible values are NotSpecified, BuiltIn, and Custom.",
          "enum": [
            "NotSpecified",
            "BuiltIn",
            "Custom"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "policyType"
          }
        }
      },
      "required": [
        "policyDefinitions"
      ]
    }
  }
}