swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: Subscription client provides an interface to create and manage Azure subscriptions programmatically.
  title: SubscriptionClient
  version: 2019-03-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/subscription/resource-manager/Microsoft.Subscription/preview/2019-03-01-preview/subscriptions.json
      version: "2.0"
  x-preferred: true
  x-providerName: azure.com
  x-serviceName: subscription-subscriptions
  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:
  apiVersionParameter:
    description: Version of the API to be used with the client request. Current version is 2019-03-01-preview
    in: query
    name: api-version
    required: true
    type: string
  subscriptionIdParameter:
    description: Subscription Id.
    in: path
    name: subscriptionId
    required: true
    type: string
    x-ms-parameter-location: method
  subscriptionNameParameter:
    description: Subscription Name
    in: body
    name: body
    required: true
    schema:
      $ref: "#/definitions/SubscriptionName"
    x-ms-parameter-location: method
paths:
  "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/cancel":
    post:
      description: The operation to cancel a subscription
      operationId: Subscriptions_Cancel
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: OK. The request has succeeded.
          schema:
            $ref: "#/definitions/CanceledSubscriptionId"
        default:
          description: Describes the error if the operation is not successful.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        cancelSubscription:
          parameters:
            api-version: 2019-03-01-preview
            subscriptionId: 83aa47df-e3e9-49ff-877b-94304bf3d3ad
          responses:
            "200":
              body:
                value: 83aa47df-e3e9-49ff-877b-94304bf3d3ad
  "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/enable":
    post:
      description: The operation to enable a subscription
      operationId: Subscriptions_Enable
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: OK. The request has succeeded.
          schema:
            $ref: "#/definitions/EnabledSubscriptionId"
        default:
          description: Describes the error if the operation is not successful.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        enableSubscription:
          parameters:
            api-version: 2019-03-01-preview
            subscriptionId: 7948bcee-488c-47ce-941c-38e20ede803d
          responses:
            "200":
              body:
                value: 7948bcee-488c-47ce-941c-38e20ede803d
  "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/rename":
    post:
      description: The operation to rename a subscription
      operationId: Subscriptions_Rename
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/subscriptionNameParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: OK. The request has succeeded.
          schema:
            $ref: "#/definitions/RenamedSubscriptionId"
        default:
          description: Describes the error if the operation is not successful.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        renameSubscription:
          parameters:
            api-version: 2019-03-01-preview
            body:
              SubscriptionName: Test Sub
            subscriptionId: 83aa47df-e3e9-49ff-877b-94304bf3d3ad
          responses:
            "200":
              body:
                value: 83aa47df-e3e9-49ff-877b-94304bf3d3ad
definitions:
  CanceledSubscriptionId:
    description: The ID of the canceled subscription
    properties:
      value:
        description: The ID of the canceled subscription
        readOnly: true
        type: string
  EnabledSubscriptionId:
    description: The ID of the subscriptions that is being enabled
    properties:
      value:
        description: The ID of the subscriptions that is being enabled
        readOnly: true
        type: string
  ErrorResponse:
    description: Describes the format of Error response.
    properties:
      code:
        description: Error code
        type: string
      message:
        description: Error message indicating why the operation failed.
        type: string
    type: object
  Operation:
    description: REST API operation
    properties:
      display:
        description: The object that represents the operation.
        properties:
          operation:
            description: "Operation type: Read, write, delete, etc."
            type: string
          provider:
            description: "Service provider: Microsoft.Subscription"
            type: string
          resource:
            description: "Resource on which the operation is performed: Profile, endpoint, etc."
            type: string
      name:
        description: "Operation name: {provider}/{resource}/{operation}"
        type: string
    type: object
  OperationListResult:
    description: Result of the request to list operations. It contains a list of operations and a URL link to get the next set of results.
    properties:
      nextLink:
        description: URL to get the next set of operation list results if there are any.
        type: string
      value:
        description: List of operations.
        items:
          $ref: "#/definitions/Operation"
        type: array
  RenamedSubscriptionId:
    description: The ID of the subscriptions that is being renamed
    properties:
      value:
        description: The ID of the subscriptions that is being renamed
        readOnly: true
        type: string
  SubscriptionName:
    description: The new name of the subscription.
    properties:
      subscriptionName:
        description: New subscription name
        type: string
    type: object
