# 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
from ._inputs import *

__all__ = [
    'GetAggregatedComputedUsagesResult',
    'AwaitableGetAggregatedComputedUsagesResult',
    'get_aggregated_computed_usages',
    'get_aggregated_computed_usages_output',
]

@pulumi.output_type
class GetAggregatedComputedUsagesResult:
    """
    A collection of values returned by getAggregatedComputedUsages.
    """
    def __init__(__self__, aggregated_computed_usages=None, compartment_id=None, filters=None, grouping=None, id=None, parent_product=None, subscription_id=None, time_from=None, time_to=None):
        if aggregated_computed_usages and not isinstance(aggregated_computed_usages, list):
            raise TypeError("Expected argument 'aggregated_computed_usages' to be a list")
        pulumi.set(__self__, "aggregated_computed_usages", aggregated_computed_usages)
        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 filters and not isinstance(filters, list):
            raise TypeError("Expected argument 'filters' to be a list")
        pulumi.set(__self__, "filters", filters)
        if grouping and not isinstance(grouping, str):
            raise TypeError("Expected argument 'grouping' to be a str")
        pulumi.set(__self__, "grouping", grouping)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if parent_product and not isinstance(parent_product, str):
            raise TypeError("Expected argument 'parent_product' to be a str")
        pulumi.set(__self__, "parent_product", parent_product)
        if subscription_id and not isinstance(subscription_id, str):
            raise TypeError("Expected argument 'subscription_id' to be a str")
        pulumi.set(__self__, "subscription_id", subscription_id)
        if time_from and not isinstance(time_from, str):
            raise TypeError("Expected argument 'time_from' to be a str")
        pulumi.set(__self__, "time_from", time_from)
        if time_to and not isinstance(time_to, str):
            raise TypeError("Expected argument 'time_to' to be a str")
        pulumi.set(__self__, "time_to", time_to)

    @property
    @pulumi.getter(name="aggregatedComputedUsages")
    def aggregated_computed_usages(self) -> Sequence['outputs.GetAggregatedComputedUsagesAggregatedComputedUsageResult']:
        """
        Aggregation of computed usages for the subscribed service.
        """
        return pulumi.get(self, "aggregated_computed_usages")

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

    @property
    @pulumi.getter
    def filters(self) -> Optional[Sequence['outputs.GetAggregatedComputedUsagesFilterResult']]:
        return pulumi.get(self, "filters")

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

    @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="parentProduct")
    def parent_product(self) -> Optional[str]:
        """
        Product description
        """
        return pulumi.get(self, "parent_product")

    @property
    @pulumi.getter(name="subscriptionId")
    def subscription_id(self) -> str:
        """
        Subscription Id is an identifier associated to the service used for filter the Computed Usage in SPM
        """
        return pulumi.get(self, "subscription_id")

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

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


class AwaitableGetAggregatedComputedUsagesResult(GetAggregatedComputedUsagesResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetAggregatedComputedUsagesResult(
            aggregated_computed_usages=self.aggregated_computed_usages,
            compartment_id=self.compartment_id,
            filters=self.filters,
            grouping=self.grouping,
            id=self.id,
            parent_product=self.parent_product,
            subscription_id=self.subscription_id,
            time_from=self.time_from,
            time_to=self.time_to)


def get_aggregated_computed_usages(compartment_id: Optional[str] = None,
                                   filters: Optional[Sequence[pulumi.InputType['GetAggregatedComputedUsagesFilterArgs']]] = None,
                                   grouping: Optional[str] = None,
                                   parent_product: Optional[str] = None,
                                   subscription_id: Optional[str] = None,
                                   time_from: Optional[str] = None,
                                   time_to: Optional[str] = None,
                                   opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetAggregatedComputedUsagesResult:
    """
    This data source provides the list of Aggregated Computed Usages in Oracle Cloud Infrastructure Onesubscription service.

    This is a collection API which returns a list of aggregated computed usage details (there can be multiple Parent Products under a given SubID each of which is represented under Subscription Service Line # in SPM).


    :param str compartment_id: The OCID of the root compartment.
    :param str grouping: Grouping criteria to use for aggregate the computed Usage, either hourly (`HOURLY`), daily (`DAILY`), monthly(`MONTHLY`) or none (`NONE`) to not follow a grouping criteria by date.
    :param str parent_product: Product part number for subscribed service line, called parent product.
    :param str subscription_id: Subscription Id is an identifier associated to the service used for filter the Computed Usage in SPM.
    :param str time_from: Initial date to filter Computed Usage data in SPM. In the case of non aggregated data the time period between of fromDate and toDate , expressed in RFC 3339 timestamp format.
    :param str time_to: Final date to filter Computed Usage data in SPM, expressed in RFC 3339 timestamp format.
    """
    __args__ = dict()
    __args__['compartmentId'] = compartment_id
    __args__['filters'] = filters
    __args__['grouping'] = grouping
    __args__['parentProduct'] = parent_product
    __args__['subscriptionId'] = subscription_id
    __args__['timeFrom'] = time_from
    __args__['timeTo'] = time_to
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('oci:OneSubsription/getAggregatedComputedUsages:getAggregatedComputedUsages', __args__, opts=opts, typ=GetAggregatedComputedUsagesResult).value

    return AwaitableGetAggregatedComputedUsagesResult(
        aggregated_computed_usages=__ret__.aggregated_computed_usages,
        compartment_id=__ret__.compartment_id,
        filters=__ret__.filters,
        grouping=__ret__.grouping,
        id=__ret__.id,
        parent_product=__ret__.parent_product,
        subscription_id=__ret__.subscription_id,
        time_from=__ret__.time_from,
        time_to=__ret__.time_to)


@_utilities.lift_output_func(get_aggregated_computed_usages)
def get_aggregated_computed_usages_output(compartment_id: Optional[pulumi.Input[str]] = None,
                                          filters: Optional[pulumi.Input[Optional[Sequence[pulumi.InputType['GetAggregatedComputedUsagesFilterArgs']]]]] = None,
                                          grouping: Optional[pulumi.Input[Optional[str]]] = None,
                                          parent_product: Optional[pulumi.Input[Optional[str]]] = None,
                                          subscription_id: Optional[pulumi.Input[str]] = None,
                                          time_from: Optional[pulumi.Input[str]] = None,
                                          time_to: Optional[pulumi.Input[str]] = None,
                                          opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetAggregatedComputedUsagesResult]:
    """
    This data source provides the list of Aggregated Computed Usages in Oracle Cloud Infrastructure Onesubscription service.

    This is a collection API which returns a list of aggregated computed usage details (there can be multiple Parent Products under a given SubID each of which is represented under Subscription Service Line # in SPM).


    :param str compartment_id: The OCID of the root compartment.
    :param str grouping: Grouping criteria to use for aggregate the computed Usage, either hourly (`HOURLY`), daily (`DAILY`), monthly(`MONTHLY`) or none (`NONE`) to not follow a grouping criteria by date.
    :param str parent_product: Product part number for subscribed service line, called parent product.
    :param str subscription_id: Subscription Id is an identifier associated to the service used for filter the Computed Usage in SPM.
    :param str time_from: Initial date to filter Computed Usage data in SPM. In the case of non aggregated data the time period between of fromDate and toDate , expressed in RFC 3339 timestamp format.
    :param str time_to: Final date to filter Computed Usage data in SPM, expressed in RFC 3339 timestamp format.
    """
    ...
