# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
from openstack import resource


class ServiceFlavor(resource.Resource):
    base_path = "/services/specifications"

    resources_key = "specifications"

    allow_list = True

    _query_mapping = resource.QueryParameters(
        "is_personal_cluster",
        "infer_type",
    )

    # Properties
    #: Unique ID of the billing specifications.
    billing_spec = resource.Body("billing_spec")
    #: Specifications description in English.
    display_en = resource.Body("display_en")
    #: Billing item.
    extend_params = resource.Body("extend_params")
    #: Whether the quota exceeds the upper limit. The value true indicates
    #:  that the quota exceeds the upper limit.
    over_quota = resource.Body("over_quota", type=bool)
    #: Whether the flavor is free of charge. The value true indicates
    #:  that the flavor is free of charge.
    is_free = resource.Body("is_free", type=bool)
    #: Whether to enable the specifications. The default value is true.
    #:  If this parameter is set to false, you need to submit a service
    #:  ticket to apply for the specifications.
    is_open = resource.Body("is_open", type=bool)
    #: Specifications status.
    #: \n`normal`: The specifications are normal.
    #: \n`sellout`: The specifications cannot be used to deploy services
    #:  because they are sold out.
    spec_status = resource.Body("spec_status")
    #: Type of the model to which the specifications apply.
    #:  `Empty`: indicates a model generated by the user.
    source_type = resource.Body("source_type")
    #: Unique specifications ID.
    specification = resource.Body("specification")
