{
  "openapi": "3.0.1",
  "info": {
    "title": "Customer Lockbox",
    "description": "Azure Customer Lockbox API Reference",
    "version": "2018-02-28-preview"
  },
  "servers": [
    {
      "url": "https://management.azure.com/"
    }
  ],
  "security": [
    {
      "azure_auth": [
        "user_impersonation"
      ]
    }
  ],
  "paths": {
    "/providers/Microsoft.CustomerLockbox/operations": {
      "get": {
        "tags": [
          "Operations"
        ],
        "description": "Lists all the available REST API operations.",
        "operationId": "Operations_List",
        "parameters": [
          {
            "name": "api-version",
            "in": "query",
            "description": "The API version to be used with the HTTP request.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. Successfully retrieved operation list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationListResult"
                }
              }
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions/{subscriptionId}/providers/Microsoft.CustomerLockbox/requests": {
      "get": {
        "tags": [
          "Requests"
        ],
        "description": "Lists all of the Lockbox requests in the given subscription.",
        "operationId": "Requests_List",
        "parameters": [
          {
            "name": "$filter",
            "in": "query",
            "description": "The $filter OData query parameter. Only filter by request status is supported, e.g $filter=properties/status eq 'Pending'",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully listed the Lockbox requests under the given subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestListResult"
                }
              }
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions/{subscriptionId}/providers/Microsoft.CustomerLockbox/requests/{requestId}": {
      "get": {
        "tags": [
          "Requests"
        ],
        "description": "Get Customer Lockbox request",
        "operationId": "Requests_Get",
        "parameters": [
          {
            "name": "requestId",
            "in": "path",
            "description": "The Lockbox request ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "description": "The API version to be used with the HTTP request.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieval of Customer Lockbox request successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LockboxRequestResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions/{subscriptionId}/providers/Microsoft.CustomerLockbox/requests/{requestId}/UpdateApproval": {
      "post": {
        "tags": [
          "Requests"
        ],
        "description": "Update Customer Lockbox request approval status API",
        "operationId": "Requests_UpdateStatus",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "description": "The Lockbox request ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "description": "The API version to be used with the HTTP request.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The approval object to update request status.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Approval"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Update of Request Status successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Approval"
                }
              }
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Approval": {
        "type": "object",
        "properties": {
          "decision": {
            "type": "string",
            "description": "Approval decision to the Lockbox request.",
            "enum": [
              "Approve",
              "Deny"
            ]
          },
          "reason": {
            "type": "string",
            "description": "Reason of the decision"
          }
        },
        "description": "Request content object, in the use of Approve or Deny a Lockbox request."
      },
      "ErrorAdditionalInfo": {
        "type": "object",
        "properties": {
          "info": {
            "type": "object",
            "properties": {
              "currentStatus": {
                "$ref": "#/components/schemas/LockboxRequestStatus"
              }
            }
          },
          "type": {
            "type": "string",
            "description": "The type of error info."
          }
        },
        "description": "An error additional info for the Lockbox service."
      },
      "ErrorBody": {
        "type": "object",
        "properties": {
          "additionalInfo": {
            "type": "array",
            "description": "A list of error details about the error.",
            "items": {
              "$ref": "#/components/schemas/ErrorAdditionalInfo"
            }
          },
          "code": {
            "type": "string",
            "description": "An identifier for the error. Codes are invariant and are intended to be consumed programmatically."
          },
          "message": {
            "type": "string",
            "description": "A message describing the error, intended to be suitable for display in a user interface."
          },
          "target": {
            "type": "string",
            "description": "The target of the particular error. For example, the name of the property in error."
          }
        },
        "description": "An error response body from the Lockbox service."
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorBody"
          }
        },
        "description": "An error response from the Lockbox service."
      },
      "LockboxRequestResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The Arm resource id of the Lockbox request.",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "description": "The name of the Lockbox request.",
            "readOnly": true
          },
          "properties": {
            "$ref": "#/components/schemas/LockboxRequestResponseProperties"
          },
          "type": {
            "type": "string",
            "description": "The type of the Lockbox request.",
            "readOnly": true
          }
        },
        "description": "A Lockbox request response object, containing all information associated with the request."
      },
      "LockboxRequestResponseProperties": {
        "type": "object",
        "properties": {
          "createdDateTime": {
            "type": "string",
            "description": "The creation time of the request.",
            "format": "date-time",
            "readOnly": true
          },
          "duration": {
            "type": "integer",
            "description": "The duration of the request in hours.",
            "format": "int32",
            "readOnly": true
          },
          "expirationDateTime": {
            "type": "string",
            "description": "The expiration time of the request.",
            "format": "date-time",
            "readOnly": true
          },
          "justification": {
            "type": "string",
            "description": "The justification of the requestor.",
            "readOnly": true
          },
          "requestId": {
            "type": "string",
            "description": "The Lockbox request ID.",
            "readOnly": true
          },
          "requestedResourceIds": {
            "type": "array",
            "description": "A list of resource IDs associated with the Lockbox request separated by ','.",
            "readOnly": true,
            "items": {
              "type": "string"
            }
          },
          "resourceType": {
            "type": "string",
            "description": "The resource type of the requested resources.",
            "readOnly": true
          },
          "status": {
            "$ref": "#/components/schemas/LockboxRequestStatus"
          },
          "subscriptionId": {
            "type": "string",
            "description": "The subscription ID.",
            "readOnly": true
          },
          "supportCaseUrl": {
            "type": "string",
            "description": "The url of the support case.",
            "readOnly": true
          },
          "supportRequest": {
            "type": "string",
            "description": "The id of the support request associated.",
            "readOnly": true
          }
        },
        "description": "The properties that are associated with a lockbox request."
      },
      "LockboxRequestStatus": {
        "type": "string",
        "description": "The status of the request.",
        "enum": [
          "Initializing",
          "Pending",
          "Approving",
          "Denying",
          "Approved",
          "Denied",
          "Expired",
          "Revoking",
          "Revoked",
          "Error",
          "Unknown",
          "Completed",
          "Completing"
        ]
      },
      "Operation": {
        "type": "object",
        "properties": {
          "display": {
            "type": "object",
            "properties": {
              "description": {
                "type": "string",
                "description": "The localized friendly description for the operation.",
                "readOnly": true
              },
              "operation": {
                "type": "string",
                "description": "The localized friendly name for the operation.",
                "readOnly": true
              },
              "provider": {
                "type": "string",
                "description": "The localized friendly form of the resource provider name.",
                "readOnly": true
              },
              "resource": {
                "type": "string",
                "description": "The localized friendly form of the resource type related to this action/operation.",
                "readOnly": true
              }
            },
            "description": "Contains the localized display information for this particular operation / action.",
            "readOnly": true
          },
          "isDataAction": {
            "type": "string",
            "description": "Gets or sets a value indicating whether it is a data plane action",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "description": "Gets or sets action name",
            "readOnly": true
          },
          "origin": {
            "type": "string",
            "description": "Gets or sets origin",
            "readOnly": true
          },
          "properties": {
            "type": "string",
            "description": "Gets or sets properties",
            "readOnly": true
          }
        },
        "description": "Operation result model for ARM RP"
      },
      "OperationListResult": {
        "type": "object",
        "properties": {
          "nextLink": {
            "type": "string",
            "description": "URL to get the next set of operation list results if there are any.",
            "readOnly": true
          },
          "value": {
            "type": "array",
            "description": "List of Customer Lockbox operations supported by the Microsoft.StreamAnalytics resource provider.",
            "readOnly": true,
            "items": {
              "$ref": "#/components/schemas/Operation"
            }
          }
        },
        "description": "Result of the request to list Customer Lockbox operations. It contains a list of operations."
      },
      "RequestListResult": {
        "type": "object",
        "properties": {
          "nextLink": {
            "type": "string",
            "description": "URL to get the next set of operation list results if there are any.",
            "readOnly": true
          },
          "value": {
            "type": "array",
            "description": "A list of Lockbox requests. Populated by a 'List' operation.",
            "readOnly": true,
            "items": {
              "$ref": "#/components/schemas/LockboxRequestResponse"
            }
          }
        },
        "description": "Object containing a list of streaming jobs."
      }
    },
    "parameters": {
      "ApiVersionParameter": {
        "name": "api-version",
        "in": "query",
        "description": "The API version to be used with the HTTP request.",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "RequestIdParameter": {
        "name": "requestId",
        "in": "path",
        "description": "The Lockbox request ID.",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "SubscriptionIdParameter": {
        "name": "subscriptionId",
        "in": "path",
        "description": "The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "securitySchemes": {
      "azure_auth": {
        "type": "oauth2",
        "description": "Azure Active Directory OAuth2 Flow."
      }
    }
  }
}