swagger: "2.0"
schemes:
  - https
host: adminmanagement.local.azurestack.external
info:
  description: The Admin Subscriptions Management Client.
  title: SubscriptionsManagementClient
  version: 2015-11-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/azsadmin/resource-manager/subscriptions/Microsoft.Subscriptions.Admin/preview/2015-11-01/AcquiredPlan.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: azsadmin-AcquiredPlan
  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:
  NewAcquiredPlanParameter:
    description: The new acquired plan.
    in: body
    name: newAcquiredPlan
    required: true
    schema:
      $ref: "#/definitions/PlanAcquisition"
    x-ms-parameter-location: method
  PlanAcquisitionIdParameter:
    description: The plan acquisition Identifier
    in: path
    name: planAcquisitionId
    required: true
    type: string
    x-ms-parameter-location: method
  TargetSubscriptionIdParameter:
    description: The target subscription ID.
    in: path
    name: targetSubscriptionId
    required: true
    type: string
    x-ms-parameter-location: method
paths:
  "/subscriptions/{subscriptionId}/providers/Microsoft.Subscriptions.Admin/subscriptions/{targetSubscriptionId}/acquiredPlans":
    get:
      description: Get a collection of all acquired plans that subscription has access to.
      operationId: AcquiredPlans_List
      parameters:
        - 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
        - $ref: "#/parameters/TargetSubscriptionIdParameter"
        - default: 2015-11-01
          description: Client Api Version.
          in: query
          name: api-version
          required: true
          type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/PlanAcquisitionList"
      tags:
        - AcquiredPlans
      x-ms-examples:
        Get a collection of all acquired plans that subscription has access to.:
          parameters:
            api-version: 2015-11-01
            location: local
            subscriptionId: 20ff7fc3-e762-44dd-bd96-b71116dcdc23
            targetSubscriptionId: 8158498d-27b1-4ccf-9aa1-de0f925731e6
          responses:
            "200":
              body:
                value:
                  - acquisitionId: 718c7f7c-4868-479a-98ce-5caaa8f158c8
                    acquisitionTime: 2018-02-17T05:50:51.48Z
                    id: /subscriptions/8158498d-27b1-4ccf-9aa1-de0f925731e6/providers/Microsoft.Subscriptions/subscriptions/8158498d-27b1-4ccf-9aa1-de0f925731e6/acquiredPlans/718c7f7c-4868-479a-98ce-5caaa8f158c8
                    planId: /subscriptions/8158498d-27b1-4ccf-9aa1-de0f925731e6/providers/Microsoft.Subscriptions/plans/balaplan
                    provisioningState: Succeeded
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/providers/Microsoft.Subscriptions.Admin/subscriptions/{targetSubscriptionId}/acquiredPlans/{planAcquisitionId}":
    delete:
      description: Deletes an acquired plan.
      operationId: AcquiredPlans_Delete
      parameters:
        - 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
        - $ref: "#/parameters/TargetSubscriptionIdParameter"
        - $ref: "#/parameters/PlanAcquisitionIdParameter"
        - default: 2015-11-01
          description: Client Api Version.
          in: query
          name: api-version
          required: true
          type: string
      responses:
        "200":
          description: OK
        "204":
          description: No Content
      tags:
        - AcquiredPlans
      x-ms-examples:
        Deletes an acquired plan.:
          parameters:
            api-version: 2015-11-01
            location: local
            planAcquisitionId: 718c7f7c-4868-479a-98ce-5caaa8f158c8
            subscriptionId: 20ff7fc3-e762-44dd-bd96-b71116dcdc23
            targetSubscriptionId: 8158498d-27b1-4ccf-9aa1-de0f925731e6
          responses:
            "200": {}
            "204": {}
    get:
      description: Gets the specified plan acquired by a subscription consuming the offer.
      operationId: AcquiredPlans_Get
      parameters:
        - 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
        - $ref: "#/parameters/TargetSubscriptionIdParameter"
        - $ref: "#/parameters/PlanAcquisitionIdParameter"
        - default: 2015-11-01
          description: Client Api Version.
          in: query
          name: api-version
          required: true
          type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/PlanAcquisition"
      tags:
        - AcquiredPlans
      x-ms-examples:
        Gets the specified plan acquired by a subscription consuming the offer:
          parameters:
            api-version: 2015-11-01
            location: local
            newAcquiredPlan: ""
            planAcquisitionId: 718c7f7c-4868-479a-98ce-5caaa8f158c8
            subscriptionId: 20ff7fc3-e762-44dd-bd96-b71116dcdc23
            targetSubscriptionId: 8158498d-27b1-4ccf-9aa1-de0f925731e6
          responses:
            "200":
              body:
                acquisitionId: 718c7f7c-4868-479a-98ce-5caaa8f158c8
                acquisitionTime: 2018-02-17T05:50:51.48Z
                id: /subscriptions/8158498d-27b1-4ccf-9aa1-de0f925731e6/providers/Microsoft.Subscriptions/subscriptions/8158498d-27b1-4ccf-9aa1-de0f925731e6/acquiredPlans/718c7f7c-4868-479a-98ce-5caaa8f158c8
                planId: /subscriptions/8158498d-27b1-4ccf-9aa1-de0f925731e6/providers/Microsoft.Subscriptions/plans/balaplan
                provisioningState: Succeeded
    put:
      description: Creates an acquired plan.
      operationId: AcquiredPlans_Create
      parameters:
        - 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
        - $ref: "#/parameters/TargetSubscriptionIdParameter"
        - $ref: "#/parameters/PlanAcquisitionIdParameter"
        - default: 2015-11-01
          description: Client Api Version.
          in: query
          name: api-version
          required: true
          type: string
        - $ref: "#/parameters/NewAcquiredPlanParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/PlanAcquisition"
        "201":
          description: Created
          schema:
            $ref: "#/definitions/PlanAcquisition"
      tags:
        - AcquiredPlans
      x-ms-examples:
        Creates or updates the acquired plan.:
          parameters:
            api-version: 2015-11-01
            location: local
            newAcquiredPlan:
              properties:
                acquisitionId: 718c7f7c-4868-479a-98ce-5caaa8f158c8
                id: /subscriptions/8158498d-27b1-4ccf-9aa1-de0f925731e6/providers/Microsoft.Subscriptions/subscriptions/8158498d-27b1-4ccf-9aa1-de0f925731e6/acquiredPlans/718c7f7c-4868-479a-98ce-5caaa8f158c8
                planId: /subscriptions/8158498d-27b1-4ccf-9aa1-de0f925731e6/providers/Microsoft.Subscriptions/plans/balaplan
            planAcquisitionId: 718c7f7c-4868-479a-98ce-5caaa8f158c8
            subscriptionId: 8158498d-27b1-4ccf-9aa1-de0f925731e6
            targetSubscriptionId: 8158498d-27b1-4ccf-9aa1-de0f925731e6
          responses:
            "200":
              body:
                acquisitionId: 718c7f7c-4868-479a-98ce-5caaa8f158c8
                acquisitionTime: 2018-02-17T05:50:51.48Z
                id: /subscriptions/8158498d-27b1-4ccf-9aa1-de0f925731e6/providers/Microsoft.Subscriptions/subscriptions/8158498d-27b1-4ccf-9aa1-de0f925731e6/acquiredPlans/718c7f7c-4868-479a-98ce-5caaa8f158c8
                planId: /subscriptions/8158498d-27b1-4ccf-9aa1-de0f925731e6/providers/Microsoft.Subscriptions/plans/balaplan
                provisioningState: Succeeded
            "201":
              body:
                acquisitionId: 718c7f7c-4868-479a-98ce-5caaa8f158c8
                acquisitionTime: 2018-02-17T05:50:51.48Z
                id: /subscriptions/8158498d-27b1-4ccf-9aa1-de0f925731e6/providers/Microsoft.Subscriptions/subscriptions/8158498d-27b1-4ccf-9aa1-de0f925731e6/acquiredPlans/718c7f7c-4868-479a-98ce-5caaa8f158c8
                planId: /subscriptions/8158498d-27b1-4ccf-9aa1-de0f925731e6/providers/Microsoft.Subscriptions/plans/balaplan
                provisioningState: Succeeded
definitions:
  PlanAcquisition:
    description: Represents the acquisition of an add-on plan for a subscription.
    properties:
      acquisitionId:
        description: Acquisition identifier.
        type: string
      acquisitionTime:
        description: Acquisition time.
        format: date-time
        type: string
      externalReferenceId:
        description: External reference identifier.
        type: string
      id:
        description: Identifier in the tenant subscription context.
        type: string
      planId:
        description: Plan identifier in the tenant subscription context.
        type: string
      provisioningState:
        $ref: "#/definitions/ProvisioningState"
        description: State of the provisioning.
    type: object
  PlanAcquisitionList:
    description: List of acquired plans.
    properties:
      nextLink:
        description: URI to the next page.
        type: string
      value:
        description: List of acquired plans.
        items:
          $ref: "#/definitions/PlanAcquisition"
        type: array
  ProvisioningState:
    description: Provisioning state for subscriptions service resources, for example, resource provider registration.
    enum:
      - NotSpecified
      - Accepted
      - Failed
      - Succeeded
    type: string
    x-ms-enum:
      modelAsString: true
      name: ProvisioningState
      values:
        - description: The provisioning state is not specified.
          name: NotSpecified
          value: NotSpecified
        - description: The provisioning state is accepted, and indicates provisioning is ongoing.
          name: Accepted
          value: Accepted
        - description: The provisioning state is failed, and indicates the data is potentially out-of-sync with third parties.
          name: Failed
          value: Failed
        - description: The provisioning state is succeeded, and indicates the data is in-sync with third-parties.
          name: Succeeded
          value: Succeeded
