# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import List, Optional

from azure.core.exceptions import HttpResponseError
import msrest.serialization


class AvailabilityEntity(msrest.serialization.Model):
    """AvailabilityEntity.

    :ivar id:
    :vartype id: str
    :ivar actions: List of allowed actions.
    :vartype actions: list[str]
    :ivar market: Market for the availability collection.
    :vartype market: str
    :ivar meter: Applicable billing meter information.
    :vartype meter: ~azure.mgmt.marketplace.v2018_08_01_beta.models.Meter
    """

    _attribute_map = {
        'id': {'key': 'id', 'type': 'str'},
        'actions': {'key': 'actions', 'type': '[str]'},
        'market': {'key': 'market', 'type': 'str'},
        'meter': {'key': 'meter', 'type': 'Meter'},
    }

    def __init__(
        self,
        *,
        id: Optional[str] = None,
        actions: Optional[List[str]] = None,
        market: Optional[str] = None,
        meter: Optional["Meter"] = None,
        **kwargs
    ):
        """
        :keyword id:
        :paramtype id: str
        :keyword actions: List of allowed actions.
        :paramtype actions: list[str]
        :keyword market: Market for the availability collection.
        :paramtype market: str
        :keyword meter: Applicable billing meter information.
        :paramtype meter: ~azure.mgmt.marketplace.v2018_08_01_beta.models.Meter
        """
        super(AvailabilityEntity, self).__init__(**kwargs)
        self.id = id
        self.actions = actions
        self.market = market
        self.meter = meter


class ErrorResponse(msrest.serialization.Model):
    """Error response indicates Microsoft.Marketplace service is not able to process the incoming request. The reason is provided in the error message.

    :ivar error: The details of the error.
    :vartype error: ~azure.mgmt.marketplace.v2018_08_01_beta.models.ErrorResponseError
    """

    _attribute_map = {
        'error': {'key': 'error', 'type': 'ErrorResponseError'},
    }

    def __init__(
        self,
        *,
        error: Optional["ErrorResponseError"] = None,
        **kwargs
    ):
        """
        :keyword error: The details of the error.
        :paramtype error: ~azure.mgmt.marketplace.v2018_08_01_beta.models.ErrorResponseError
        """
        super(ErrorResponse, self).__init__(**kwargs)
        self.error = error


class ErrorResponseError(msrest.serialization.Model):
    """The details of the error.

    Variables are only populated by the server, and will be ignored when sending a request.

    :ivar code: Error code.
    :vartype code: str
    :ivar message: Error message indicating why the operation failed.
    :vartype message: str
    """

    _validation = {
        'code': {'readonly': True},
        'message': {'readonly': True},
    }

    _attribute_map = {
        'code': {'key': 'code', 'type': 'str'},
        'message': {'key': 'message', 'type': 'str'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        """
        super(ErrorResponseError, self).__init__(**kwargs)
        self.code = None
        self.message = None


class IncludedQuantityProperty(msrest.serialization.Model):
    """IncludedQuantityProperty.

    :ivar term_id: Term id.
    :vartype term_id: str
    :ivar quantity: Quantity.
    :vartype quantity: str
    """

    _attribute_map = {
        'term_id': {'key': 'termId', 'type': 'str'},
        'quantity': {'key': 'quantity', 'type': 'str'},
    }

    def __init__(
        self,
        *,
        term_id: Optional[str] = None,
        quantity: Optional[str] = None,
        **kwargs
    ):
        """
        :keyword term_id: Term id.
        :paramtype term_id: str
        :keyword quantity: Quantity.
        :paramtype quantity: str
        """
        super(IncludedQuantityProperty, self).__init__(**kwargs)
        self.term_id = term_id
        self.quantity = quantity


class Meter(msrest.serialization.Model):
    """Meter.

    :ivar meter_id: Metetr id.
    :vartype meter_id: str
    :ivar price: Price for this meter.
    :vartype price: ~azure.mgmt.marketplace.v2018_08_01_beta.models.Price
    :ivar included_quantity_properties: Included quantity properties.
    :vartype included_quantity_properties:
     list[~azure.mgmt.marketplace.v2018_08_01_beta.models.IncludedQuantityProperty]
    """

    _attribute_map = {
        'meter_id': {'key': 'meterId', 'type': 'str'},
        'price': {'key': 'price', 'type': 'Price'},
        'included_quantity_properties': {'key': 'includedQuantityProperties', 'type': '[IncludedQuantityProperty]'},
    }

    def __init__(
        self,
        *,
        meter_id: Optional[str] = None,
        price: Optional["Price"] = None,
        included_quantity_properties: Optional[List["IncludedQuantityProperty"]] = None,
        **kwargs
    ):
        """
        :keyword meter_id: Metetr id.
        :paramtype meter_id: str
        :keyword price: Price for this meter.
        :paramtype price: ~azure.mgmt.marketplace.v2018_08_01_beta.models.Price
        :keyword included_quantity_properties: Included quantity properties.
        :paramtype included_quantity_properties:
         list[~azure.mgmt.marketplace.v2018_08_01_beta.models.IncludedQuantityProperty]
        """
        super(Meter, self).__init__(**kwargs)
        self.meter_id = meter_id
        self.price = price
        self.included_quantity_properties = included_quantity_properties


class Offer(msrest.serialization.Model):
    """The offer data structure.

    Variables are only populated by the server, and will be ignored when sending a request.

    :ivar offer_id: Offers unique id.
    :vartype offer_id: str
    :ivar display_name: It will be displayed prominently in the marketplace.
    :vartype display_name: str
    :ivar publisher_id: Publisher unique id.
    :vartype publisher_id: str
    :ivar publisher_display_name: Publisher name that will be displayed prominently in the
     marketplace.
    :vartype publisher_display_name: str
    :ivar e_tag: Identifier for purposes of race condition.
    :vartype e_tag: str
    :ivar plans: Offer plans.
    :vartype plans: list[~azure.mgmt.marketplace.v2018_08_01_beta.models.Plan]
    """

    _validation = {
        'offer_id': {'readonly': True},
        'display_name': {'readonly': True},
        'publisher_id': {'readonly': True},
        'publisher_display_name': {'readonly': True},
    }

    _attribute_map = {
        'offer_id': {'key': 'properties.offerId', 'type': 'str'},
        'display_name': {'key': 'properties.displayName', 'type': 'str'},
        'publisher_id': {'key': 'properties.publisherId', 'type': 'str'},
        'publisher_display_name': {'key': 'properties.publisherDisplayName', 'type': 'str'},
        'e_tag': {'key': 'properties.eTag', 'type': 'str'},
        'plans': {'key': 'properties.plans', 'type': '[Plan]'},
    }

    def __init__(
        self,
        *,
        e_tag: Optional[str] = None,
        plans: Optional[List["Plan"]] = None,
        **kwargs
    ):
        """
        :keyword e_tag: Identifier for purposes of race condition.
        :paramtype e_tag: str
        :keyword plans: Offer plans.
        :paramtype plans: list[~azure.mgmt.marketplace.v2018_08_01_beta.models.Plan]
        """
        super(Offer, self).__init__(**kwargs)
        self.offer_id = None
        self.display_name = None
        self.publisher_id = None
        self.publisher_display_name = None
        self.e_tag = e_tag
        self.plans = plans


class OfferListResponse(msrest.serialization.Model):
    """OfferListResponse.

    :ivar value:
    :vartype value: list[~azure.mgmt.marketplace.v2018_08_01_beta.models.Offer]
    :ivar next_link: URL to get the next set of offer list results if there are any.
    :vartype next_link: str
    """

    _attribute_map = {
        'value': {'key': 'value', 'type': '[Offer]'},
        'next_link': {'key': 'nextLink', 'type': 'str'},
    }

    def __init__(
        self,
        *,
        value: Optional[List["Offer"]] = None,
        next_link: Optional[str] = None,
        **kwargs
    ):
        """
        :keyword value:
        :paramtype value: list[~azure.mgmt.marketplace.v2018_08_01_beta.models.Offer]
        :keyword next_link: URL to get the next set of offer list results if there are any.
        :paramtype next_link: str
        """
        super(OfferListResponse, self).__init__(**kwargs)
        self.value = value
        self.next_link = next_link


class Plan(msrest.serialization.Model):
    """Plan.

    Variables are only populated by the server, and will be ignored when sending a request.

    :ivar description: Description for this plan.
    :vartype description: str
    :ivar plan_id: Text identifier for this plan.
    :vartype plan_id: str
    :ivar display_name: Friendly name for the plan for display in the marketplace.
    :vartype display_name: str
    :ivar availabilities:
    :vartype availabilities:
     list[~azure.mgmt.marketplace.v2018_08_01_beta.models.AvailabilityEntity]
    """

    _validation = {
        'description': {'readonly': True},
        'plan_id': {'readonly': True},
        'display_name': {'readonly': True},
    }

    _attribute_map = {
        'description': {'key': 'description', 'type': 'str'},
        'plan_id': {'key': 'planId', 'type': 'str'},
        'display_name': {'key': 'displayName', 'type': 'str'},
        'availabilities': {'key': 'availabilities', 'type': '[AvailabilityEntity]'},
    }

    def __init__(
        self,
        *,
        availabilities: Optional[List["AvailabilityEntity"]] = None,
        **kwargs
    ):
        """
        :keyword availabilities:
        :paramtype availabilities:
         list[~azure.mgmt.marketplace.v2018_08_01_beta.models.AvailabilityEntity]
        """
        super(Plan, self).__init__(**kwargs)
        self.description = None
        self.plan_id = None
        self.display_name = None
        self.availabilities = availabilities


class Price(msrest.serialization.Model):
    """Price.

    :ivar currency_code: Currency code i.e. 'USD'.
    :vartype currency_code: str
    :ivar list_price: Retail price for the item.
    :vartype list_price: float
    """

    _attribute_map = {
        'currency_code': {'key': 'currencyCode', 'type': 'str'},
        'list_price': {'key': 'listPrice', 'type': 'float'},
    }

    def __init__(
        self,
        *,
        currency_code: Optional[str] = None,
        list_price: Optional[float] = None,
        **kwargs
    ):
        """
        :keyword currency_code: Currency code i.e. 'USD'.
        :paramtype currency_code: str
        :keyword list_price: Retail price for the item.
        :paramtype list_price: float
        """
        super(Price, self).__init__(**kwargs)
        self.currency_code = currency_code
        self.list_price = list_price
