# 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 warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities

__all__ = [
    'GetAppSecContractsGroupsResult',
    'AwaitableGetAppSecContractsGroupsResult',
    'get_app_sec_contracts_groups',
]

@pulumi.output_type
class GetAppSecContractsGroupsResult:
    """
    A collection of values returned by getAppSecContractsGroups.
    """
    def __init__(__self__, contractid=None, default_contractid=None, default_groupid=None, groupid=None, id=None, json=None, output_text=None):
        if contractid and not isinstance(contractid, str):
            raise TypeError("Expected argument 'contractid' to be a str")
        pulumi.set(__self__, "contractid", contractid)
        if default_contractid and not isinstance(default_contractid, str):
            raise TypeError("Expected argument 'default_contractid' to be a str")
        pulumi.set(__self__, "default_contractid", default_contractid)
        if default_groupid and not isinstance(default_groupid, int):
            raise TypeError("Expected argument 'default_groupid' to be a int")
        pulumi.set(__self__, "default_groupid", default_groupid)
        if groupid and not isinstance(groupid, int):
            raise TypeError("Expected argument 'groupid' to be a int")
        pulumi.set(__self__, "groupid", groupid)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if json and not isinstance(json, str):
            raise TypeError("Expected argument 'json' to be a str")
        pulumi.set(__self__, "json", json)
        if output_text and not isinstance(output_text, str):
            raise TypeError("Expected argument 'output_text' to be a str")
        pulumi.set(__self__, "output_text", output_text)

    @property
    @pulumi.getter
    def contractid(self) -> Optional[str]:
        """
        (Optional) The ID of a contract for which to retrieve information.
        """
        return pulumi.get(self, "contractid")

    @property
    @pulumi.getter(name="defaultContractid")
    def default_contractid(self) -> str:
        """
        The default contract ID for the specified contract and group.
        """
        return pulumi.get(self, "default_contractid")

    @property
    @pulumi.getter(name="defaultGroupid")
    def default_groupid(self) -> int:
        """
        The default group ID for the specified contract and group.
        """
        return pulumi.get(self, "default_groupid")

    @property
    @pulumi.getter
    def groupid(self) -> Optional[int]:
        """
        (Optional) The ID of a group for which to retrieve information.
        """
        return pulumi.get(self, "groupid")

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

    @property
    @pulumi.getter
    def json(self) -> str:
        """
        A JSON-formatted list of the contract and group information.
        """
        return pulumi.get(self, "json")

    @property
    @pulumi.getter(name="outputText")
    def output_text(self) -> str:
        """
        A tabular display showing the contract and group information.
        """
        return pulumi.get(self, "output_text")


class AwaitableGetAppSecContractsGroupsResult(GetAppSecContractsGroupsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetAppSecContractsGroupsResult(
            contractid=self.contractid,
            default_contractid=self.default_contractid,
            default_groupid=self.default_groupid,
            groupid=self.groupid,
            id=self.id,
            json=self.json,
            output_text=self.output_text)


def get_app_sec_contracts_groups(contractid: Optional[str] = None,
                                 groupid: Optional[int] = None,
                                 opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetAppSecContractsGroupsResult:
    """
    Use the `getAppSecContractsGroups` data source to retrieve information about the contracts and groups for your account. Each object contains the contract, groups associated with the contract, and whether Kona Site Defender or Web Application Protector is the product for that contract. You’ll need this information when you create a new security configuration or when you want to get a list of hostnames still available for use in a security policy. The information available via this data source is described [here](https://developer.akamai.com/api/cloud_security/application_security/v1.html#getcontractsandgroupswithksdorwaf).

    ## Example Usage

    Basic usage:

    ```python
    import pulumi
    import pulumi_akamai as akamai

    contracts_groups = akamai.get_app_sec_contracts_groups(contractid=var["contractid"],
        groupid=var["groupid"])
    pulumi.export("contractsGroupsList", contracts_groups.output_text)
    pulumi.export("contractsGroupsJson", contracts_groups.json)
    pulumi.export("contractGroupsDefaultContractid", contracts_groups.default_contractid)
    pulumi.export("contractGroupsDefaultGroupid", contracts_groups.default_groupid)
    ```


    :param str contractid: (Optional) The ID of a contract for which to retrieve information.
    :param int groupid: (Optional) The ID of a group for which to retrieve information.
    """
    __args__ = dict()
    __args__['contractid'] = contractid
    __args__['groupid'] = groupid
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = _utilities.get_version()
    __ret__ = pulumi.runtime.invoke('akamai:index/getAppSecContractsGroups:getAppSecContractsGroups', __args__, opts=opts, typ=GetAppSecContractsGroupsResult).value

    return AwaitableGetAppSecContractsGroupsResult(
        contractid=__ret__.contractid,
        default_contractid=__ret__.default_contractid,
        default_groupid=__ret__.default_groupid,
        groupid=__ret__.groupid,
        id=__ret__.id,
        json=__ret__.json,
        output_text=__ret__.output_text)
