# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs

__all__ = [
    'GetComputedUsageResult',
    'AwaitableGetComputedUsageResult',
    'get_computed_usage',
    'get_computed_usage_output',
]

@pulumi.output_type
class GetComputedUsageResult:
    """
    A collection of values returned by getComputedUsage.
    """
    def __init__(__self__, commitment_service_id=None, compartment_id=None, compute_source=None, computed_usage_id=None, cost=None, cost_rounded=None, currency_code=None, data_center=None, fields=None, id=None, is_invoiced=None, mqs_message_id=None, net_unit_price=None, original_usage_number=None, parent_products=None, parent_subscribed_service_id=None, plan_number=None, products=None, quantity=None, rate_card_id=None, rate_card_tierd_id=None, time_created=None, time_metered_on=None, time_of_arrival=None, time_updated=None, type=None, unit_of_measure=None, usage_number=None, x_one_origin_region=None):
        if commitment_service_id and not isinstance(commitment_service_id, str):
            raise TypeError("Expected argument 'commitment_service_id' to be a str")
        pulumi.set(__self__, "commitment_service_id", commitment_service_id)
        if compartment_id and not isinstance(compartment_id, str):
            raise TypeError("Expected argument 'compartment_id' to be a str")
        pulumi.set(__self__, "compartment_id", compartment_id)
        if compute_source and not isinstance(compute_source, str):
            raise TypeError("Expected argument 'compute_source' to be a str")
        pulumi.set(__self__, "compute_source", compute_source)
        if computed_usage_id and not isinstance(computed_usage_id, str):
            raise TypeError("Expected argument 'computed_usage_id' to be a str")
        pulumi.set(__self__, "computed_usage_id", computed_usage_id)
        if cost and not isinstance(cost, str):
            raise TypeError("Expected argument 'cost' to be a str")
        pulumi.set(__self__, "cost", cost)
        if cost_rounded and not isinstance(cost_rounded, str):
            raise TypeError("Expected argument 'cost_rounded' to be a str")
        pulumi.set(__self__, "cost_rounded", cost_rounded)
        if currency_code and not isinstance(currency_code, str):
            raise TypeError("Expected argument 'currency_code' to be a str")
        pulumi.set(__self__, "currency_code", currency_code)
        if data_center and not isinstance(data_center, str):
            raise TypeError("Expected argument 'data_center' to be a str")
        pulumi.set(__self__, "data_center", data_center)
        if fields and not isinstance(fields, list):
            raise TypeError("Expected argument 'fields' to be a list")
        pulumi.set(__self__, "fields", fields)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if is_invoiced and not isinstance(is_invoiced, bool):
            raise TypeError("Expected argument 'is_invoiced' to be a bool")
        pulumi.set(__self__, "is_invoiced", is_invoiced)
        if mqs_message_id and not isinstance(mqs_message_id, str):
            raise TypeError("Expected argument 'mqs_message_id' to be a str")
        pulumi.set(__self__, "mqs_message_id", mqs_message_id)
        if net_unit_price and not isinstance(net_unit_price, str):
            raise TypeError("Expected argument 'net_unit_price' to be a str")
        pulumi.set(__self__, "net_unit_price", net_unit_price)
        if original_usage_number and not isinstance(original_usage_number, str):
            raise TypeError("Expected argument 'original_usage_number' to be a str")
        pulumi.set(__self__, "original_usage_number", original_usage_number)
        if parent_products and not isinstance(parent_products, list):
            raise TypeError("Expected argument 'parent_products' to be a list")
        pulumi.set(__self__, "parent_products", parent_products)
        if parent_subscribed_service_id and not isinstance(parent_subscribed_service_id, str):
            raise TypeError("Expected argument 'parent_subscribed_service_id' to be a str")
        pulumi.set(__self__, "parent_subscribed_service_id", parent_subscribed_service_id)
        if plan_number and not isinstance(plan_number, str):
            raise TypeError("Expected argument 'plan_number' to be a str")
        pulumi.set(__self__, "plan_number", plan_number)
        if products and not isinstance(products, list):
            raise TypeError("Expected argument 'products' to be a list")
        pulumi.set(__self__, "products", products)
        if quantity and not isinstance(quantity, str):
            raise TypeError("Expected argument 'quantity' to be a str")
        pulumi.set(__self__, "quantity", quantity)
        if rate_card_id and not isinstance(rate_card_id, str):
            raise TypeError("Expected argument 'rate_card_id' to be a str")
        pulumi.set(__self__, "rate_card_id", rate_card_id)
        if rate_card_tierd_id and not isinstance(rate_card_tierd_id, str):
            raise TypeError("Expected argument 'rate_card_tierd_id' to be a str")
        pulumi.set(__self__, "rate_card_tierd_id", rate_card_tierd_id)
        if time_created and not isinstance(time_created, str):
            raise TypeError("Expected argument 'time_created' to be a str")
        pulumi.set(__self__, "time_created", time_created)
        if time_metered_on and not isinstance(time_metered_on, str):
            raise TypeError("Expected argument 'time_metered_on' to be a str")
        pulumi.set(__self__, "time_metered_on", time_metered_on)
        if time_of_arrival and not isinstance(time_of_arrival, str):
            raise TypeError("Expected argument 'time_of_arrival' to be a str")
        pulumi.set(__self__, "time_of_arrival", time_of_arrival)
        if time_updated and not isinstance(time_updated, str):
            raise TypeError("Expected argument 'time_updated' to be a str")
        pulumi.set(__self__, "time_updated", time_updated)
        if type and not isinstance(type, str):
            raise TypeError("Expected argument 'type' to be a str")
        pulumi.set(__self__, "type", type)
        if unit_of_measure and not isinstance(unit_of_measure, str):
            raise TypeError("Expected argument 'unit_of_measure' to be a str")
        pulumi.set(__self__, "unit_of_measure", unit_of_measure)
        if usage_number and not isinstance(usage_number, str):
            raise TypeError("Expected argument 'usage_number' to be a str")
        pulumi.set(__self__, "usage_number", usage_number)
        if x_one_origin_region and not isinstance(x_one_origin_region, str):
            raise TypeError("Expected argument 'x_one_origin_region' to be a str")
        pulumi.set(__self__, "x_one_origin_region", x_one_origin_region)

    @property
    @pulumi.getter(name="commitmentServiceId")
    def commitment_service_id(self) -> str:
        """
        Subscribed service commitmentId.
        """
        return pulumi.get(self, "commitment_service_id")

    @property
    @pulumi.getter(name="compartmentId")
    def compartment_id(self) -> str:
        return pulumi.get(self, "compartment_id")

    @property
    @pulumi.getter(name="computeSource")
    def compute_source(self) -> str:
        """
        SPM Internal compute records source .
        """
        return pulumi.get(self, "compute_source")

    @property
    @pulumi.getter(name="computedUsageId")
    def computed_usage_id(self) -> str:
        return pulumi.get(self, "computed_usage_id")

    @property
    @pulumi.getter
    def cost(self) -> str:
        """
        Computed Line Amount not rounded
        """
        return pulumi.get(self, "cost")

    @property
    @pulumi.getter(name="costRounded")
    def cost_rounded(self) -> str:
        """
        Computed Line Amount rounded.
        """
        return pulumi.get(self, "cost_rounded")

    @property
    @pulumi.getter(name="currencyCode")
    def currency_code(self) -> str:
        """
        Currency code
        """
        return pulumi.get(self, "currency_code")

    @property
    @pulumi.getter(name="dataCenter")
    def data_center(self) -> str:
        """
        Data Center Attribute as sent by MQS to SPM.
        """
        return pulumi.get(self, "data_center")

    @property
    @pulumi.getter
    def fields(self) -> Optional[Sequence[str]]:
        return pulumi.get(self, "fields")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="isInvoiced")
    def is_invoiced(self) -> bool:
        """
        Invoicing status for the aggregated compute usage
        """
        return pulumi.get(self, "is_invoiced")

    @property
    @pulumi.getter(name="mqsMessageId")
    def mqs_message_id(self) -> str:
        """
        MQS Identfier send to SPM , SPM does not transform this attribute and is received as is.
        """
        return pulumi.get(self, "mqs_message_id")

    @property
    @pulumi.getter(name="netUnitPrice")
    def net_unit_price(self) -> str:
        """
        Net Unit Price for the product in consideration, price actual.
        """
        return pulumi.get(self, "net_unit_price")

    @property
    @pulumi.getter(name="originalUsageNumber")
    def original_usage_number(self) -> str:
        """
        SPM Internal Original usage Line number identifier in SPM coming from Metered Services entity.
        """
        return pulumi.get(self, "original_usage_number")

    @property
    @pulumi.getter(name="parentProducts")
    def parent_products(self) -> Sequence['outputs.GetComputedUsageParentProductResult']:
        """
        Product description
        """
        return pulumi.get(self, "parent_products")

    @property
    @pulumi.getter(name="parentSubscribedServiceId")
    def parent_subscribed_service_id(self) -> str:
        """
        Subscribed service line parent id
        """
        return pulumi.get(self, "parent_subscribed_service_id")

    @property
    @pulumi.getter(name="planNumber")
    def plan_number(self) -> str:
        """
        Subscription plan number
        """
        return pulumi.get(self, "plan_number")

    @property
    @pulumi.getter
    def products(self) -> Sequence['outputs.GetComputedUsageProductResult']:
        """
        Product description
        """
        return pulumi.get(self, "products")

    @property
    @pulumi.getter
    def quantity(self) -> str:
        """
        Total Quantity that was used for computation
        """
        return pulumi.get(self, "quantity")

    @property
    @pulumi.getter(name="rateCardId")
    def rate_card_id(self) -> str:
        """
        Ratecard Id at subscribed service level
        """
        return pulumi.get(self, "rate_card_id")

    @property
    @pulumi.getter(name="rateCardTierdId")
    def rate_card_tierd_id(self) -> str:
        """
        References the tier in the ratecard for that usage (OCI will be using the same reference to cross-reference for correctness on the usage csv report), comes from Entity OBSCNTR_IPT_PRODUCTTIER.
        """
        return pulumi.get(self, "rate_card_tierd_id")

    @property
    @pulumi.getter(name="timeCreated")
    def time_created(self) -> str:
        """
        Computed Usage created time, expressed in RFC 3339 timestamp format.
        """
        return pulumi.get(self, "time_created")

    @property
    @pulumi.getter(name="timeMeteredOn")
    def time_metered_on(self) -> str:
        """
        Metered Service date, expressed in RFC 3339 timestamp format.
        """
        return pulumi.get(self, "time_metered_on")

    @property
    @pulumi.getter(name="timeOfArrival")
    def time_of_arrival(self) -> str:
        """
        Usae computation date, expressed in RFC 3339 timestamp format.
        """
        return pulumi.get(self, "time_of_arrival")

    @property
    @pulumi.getter(name="timeUpdated")
    def time_updated(self) -> str:
        """
        Computed Usage updated time, expressed in RFC 3339 timestamp format.
        """
        return pulumi.get(self, "time_updated")

    @property
    @pulumi.getter
    def type(self) -> str:
        """
        Usage compute type in SPM.
        """
        return pulumi.get(self, "type")

    @property
    @pulumi.getter(name="unitOfMeasure")
    def unit_of_measure(self) -> str:
        """
        Unit of Messure
        """
        return pulumi.get(self, "unit_of_measure")

    @property
    @pulumi.getter(name="usageNumber")
    def usage_number(self) -> str:
        """
        SPM Internal usage Line number identifier in SPM coming from Metered Services entity.
        """
        return pulumi.get(self, "usage_number")

    @property
    @pulumi.getter(name="xOneOriginRegion")
    def x_one_origin_region(self) -> Optional[str]:
        return pulumi.get(self, "x_one_origin_region")


class AwaitableGetComputedUsageResult(GetComputedUsageResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetComputedUsageResult(
            commitment_service_id=self.commitment_service_id,
            compartment_id=self.compartment_id,
            compute_source=self.compute_source,
            computed_usage_id=self.computed_usage_id,
            cost=self.cost,
            cost_rounded=self.cost_rounded,
            currency_code=self.currency_code,
            data_center=self.data_center,
            fields=self.fields,
            id=self.id,
            is_invoiced=self.is_invoiced,
            mqs_message_id=self.mqs_message_id,
            net_unit_price=self.net_unit_price,
            original_usage_number=self.original_usage_number,
            parent_products=self.parent_products,
            parent_subscribed_service_id=self.parent_subscribed_service_id,
            plan_number=self.plan_number,
            products=self.products,
            quantity=self.quantity,
            rate_card_id=self.rate_card_id,
            rate_card_tierd_id=self.rate_card_tierd_id,
            time_created=self.time_created,
            time_metered_on=self.time_metered_on,
            time_of_arrival=self.time_of_arrival,
            time_updated=self.time_updated,
            type=self.type,
            unit_of_measure=self.unit_of_measure,
            usage_number=self.usage_number,
            x_one_origin_region=self.x_one_origin_region)


def get_computed_usage(compartment_id: Optional[str] = None,
                       computed_usage_id: Optional[str] = None,
                       fields: Optional[Sequence[str]] = None,
                       x_one_origin_region: Optional[str] = None,
                       opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetComputedUsageResult:
    """
    This data source provides details about a specific Computed Usage resource in Oracle Cloud Infrastructure Osub Usage service.

    This is an API which returns Computed Usage corresponding to the id passed

    ## Example Usage

    ```python
    import pulumi
    import pulumi_oci as oci

    test_computed_usage = oci.OsubUsage.get_computed_usage(compartment_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        computed_usage_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        fields=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        x_one_origin_region=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    ```


    :param str compartment_id: The OCID of the root compartment.
    :param str computed_usage_id: The Computed Usage Id
    :param Sequence[str] fields: Partial response refers to an optimization technique offered by the RESTful web APIs to return only the information  (fields) required by the client. This parameter is used to control what fields to return.
    :param str x_one_origin_region: The Oracle Cloud Infrastructure home region name in case home region is not us-ashburn-1 (IAD), e.g. ap-mumbai-1, us-phoenix-1 etc.
    """
    __args__ = dict()
    __args__['compartmentId'] = compartment_id
    __args__['computedUsageId'] = computed_usage_id
    __args__['fields'] = fields
    __args__['xOneOriginRegion'] = x_one_origin_region
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('oci:OsubUsage/getComputedUsage:getComputedUsage', __args__, opts=opts, typ=GetComputedUsageResult).value

    return AwaitableGetComputedUsageResult(
        commitment_service_id=__ret__.commitment_service_id,
        compartment_id=__ret__.compartment_id,
        compute_source=__ret__.compute_source,
        computed_usage_id=__ret__.computed_usage_id,
        cost=__ret__.cost,
        cost_rounded=__ret__.cost_rounded,
        currency_code=__ret__.currency_code,
        data_center=__ret__.data_center,
        fields=__ret__.fields,
        id=__ret__.id,
        is_invoiced=__ret__.is_invoiced,
        mqs_message_id=__ret__.mqs_message_id,
        net_unit_price=__ret__.net_unit_price,
        original_usage_number=__ret__.original_usage_number,
        parent_products=__ret__.parent_products,
        parent_subscribed_service_id=__ret__.parent_subscribed_service_id,
        plan_number=__ret__.plan_number,
        products=__ret__.products,
        quantity=__ret__.quantity,
        rate_card_id=__ret__.rate_card_id,
        rate_card_tierd_id=__ret__.rate_card_tierd_id,
        time_created=__ret__.time_created,
        time_metered_on=__ret__.time_metered_on,
        time_of_arrival=__ret__.time_of_arrival,
        time_updated=__ret__.time_updated,
        type=__ret__.type,
        unit_of_measure=__ret__.unit_of_measure,
        usage_number=__ret__.usage_number,
        x_one_origin_region=__ret__.x_one_origin_region)


@_utilities.lift_output_func(get_computed_usage)
def get_computed_usage_output(compartment_id: Optional[pulumi.Input[str]] = None,
                              computed_usage_id: Optional[pulumi.Input[str]] = None,
                              fields: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
                              x_one_origin_region: Optional[pulumi.Input[Optional[str]]] = None,
                              opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetComputedUsageResult]:
    """
    This data source provides details about a specific Computed Usage resource in Oracle Cloud Infrastructure Osub Usage service.

    This is an API which returns Computed Usage corresponding to the id passed

    ## Example Usage

    ```python
    import pulumi
    import pulumi_oci as oci

    test_computed_usage = oci.OsubUsage.get_computed_usage(compartment_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        computed_usage_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        fields=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        x_one_origin_region=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    ```


    :param str compartment_id: The OCID of the root compartment.
    :param str computed_usage_id: The Computed Usage Id
    :param Sequence[str] fields: Partial response refers to an optimization technique offered by the RESTful web APIs to return only the information  (fields) required by the client. This parameter is used to control what fields to return.
    :param str x_one_origin_region: The Oracle Cloud Infrastructure home region name in case home region is not us-ashburn-1 (IAD), e.g. ap-mumbai-1, us-phoenix-1 etc.
    """
    ...
