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

__all__ = ['GtmGeomapArgs', 'GtmGeomap']

@pulumi.input_type
class GtmGeomapArgs:
    def __init__(__self__, *,
                 default_datacenter: pulumi.Input['GtmGeomapDefaultDatacenterArgs'],
                 domain: pulumi.Input[str],
                 assignments: Optional[pulumi.Input[Sequence[pulumi.Input['GtmGeomapAssignmentArgs']]]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 wait_on_complete: Optional[pulumi.Input[bool]] = None):
        """
        The set of arguments for constructing a GtmGeomap resource.
        """
        pulumi.set(__self__, "default_datacenter", default_datacenter)
        pulumi.set(__self__, "domain", domain)
        if assignments is not None:
            pulumi.set(__self__, "assignments", assignments)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if wait_on_complete is not None:
            pulumi.set(__self__, "wait_on_complete", wait_on_complete)

    @property
    @pulumi.getter(name="defaultDatacenter")
    def default_datacenter(self) -> pulumi.Input['GtmGeomapDefaultDatacenterArgs']:
        return pulumi.get(self, "default_datacenter")

    @default_datacenter.setter
    def default_datacenter(self, value: pulumi.Input['GtmGeomapDefaultDatacenterArgs']):
        pulumi.set(self, "default_datacenter", value)

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

    @domain.setter
    def domain(self, value: pulumi.Input[str]):
        pulumi.set(self, "domain", value)

    @property
    @pulumi.getter
    def assignments(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['GtmGeomapAssignmentArgs']]]]:
        return pulumi.get(self, "assignments")

    @assignments.setter
    def assignments(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['GtmGeomapAssignmentArgs']]]]):
        pulumi.set(self, "assignments", value)

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

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter(name="waitOnComplete")
    def wait_on_complete(self) -> Optional[pulumi.Input[bool]]:
        return pulumi.get(self, "wait_on_complete")

    @wait_on_complete.setter
    def wait_on_complete(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "wait_on_complete", value)


@pulumi.input_type
class _GtmGeomapState:
    def __init__(__self__, *,
                 assignments: Optional[pulumi.Input[Sequence[pulumi.Input['GtmGeomapAssignmentArgs']]]] = None,
                 default_datacenter: Optional[pulumi.Input['GtmGeomapDefaultDatacenterArgs']] = None,
                 domain: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 wait_on_complete: Optional[pulumi.Input[bool]] = None):
        """
        Input properties used for looking up and filtering GtmGeomap resources.
        """
        if assignments is not None:
            pulumi.set(__self__, "assignments", assignments)
        if default_datacenter is not None:
            pulumi.set(__self__, "default_datacenter", default_datacenter)
        if domain is not None:
            pulumi.set(__self__, "domain", domain)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if wait_on_complete is not None:
            pulumi.set(__self__, "wait_on_complete", wait_on_complete)

    @property
    @pulumi.getter
    def assignments(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['GtmGeomapAssignmentArgs']]]]:
        return pulumi.get(self, "assignments")

    @assignments.setter
    def assignments(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['GtmGeomapAssignmentArgs']]]]):
        pulumi.set(self, "assignments", value)

    @property
    @pulumi.getter(name="defaultDatacenter")
    def default_datacenter(self) -> Optional[pulumi.Input['GtmGeomapDefaultDatacenterArgs']]:
        return pulumi.get(self, "default_datacenter")

    @default_datacenter.setter
    def default_datacenter(self, value: Optional[pulumi.Input['GtmGeomapDefaultDatacenterArgs']]):
        pulumi.set(self, "default_datacenter", value)

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

    @domain.setter
    def domain(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "domain", value)

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

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter(name="waitOnComplete")
    def wait_on_complete(self) -> Optional[pulumi.Input[bool]]:
        return pulumi.get(self, "wait_on_complete")

    @wait_on_complete.setter
    def wait_on_complete(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "wait_on_complete", value)


class GtmGeomap(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 assignments: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['GtmGeomapAssignmentArgs']]]]] = None,
                 default_datacenter: Optional[pulumi.Input[pulumi.InputType['GtmGeomapDefaultDatacenterArgs']]] = None,
                 domain: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 wait_on_complete: Optional[pulumi.Input[bool]] = None,
                 __props__=None):
        """
        Use the `GtmGeomap` resource to create, configure, and import a GTM Geographic map. Geographic mapping lets you configure a property that returns a CNAME based on the geographic location of the request.

        You can reuse maps for multiple properties or create new ones. To configure a property for geographic mapping, you need to define at least one geographic map for your domain. Each map needs at least two definitions. For example, you can have one definition that maps a set of countries to a specific data center, and a second definition that routes all other traffic.

        > **Note** Import requires an ID with this format: `existing_domain_name`:`existing_map_name`.

        ## Example Usage

        Basic usage:

        ```python
        import pulumi
        import pulumi_akamai as akamai

        demo_geomap = akamai.GtmGeomap("demoGeomap",
            default_datacenter=akamai.GtmGeomapDefaultDatacenterArgs(
                datacenter_id=5400,
                nickname="All Others",
            ),
            domain="demo_domain.akadns.net")
        ```
        ## Argument reference

        This resource supports these arguments:

        * `domain` - (Required) GTM Domain name for the Geographic Map.
        * `name` - (Required) A descriptive label for the Geographic map.
        * `default_datacenter` - (Required) A placeholder for all other geographic zones. Requires these additional arguments:
          * `datacenter_id` - (Required) For each property, an identifier for all other geographic zones.
          * `nickname` - (Required) A descriptive label for all other geographic zones.
        * `wait_on_complete` - (Optional) A boolean indicating whether to wait for transaction to complete. Set to `true` by default.
        * `assignment` - (Optional) Contains information about the geographic zone groupings of countries. You can have multiple `assignment` arguments. If used, requires these additional arguments:
          * `datacenter_id` - (Optional) A unique identifier for an existing data center in the domain.
          * `nickname` - (Optional) A descriptive label for the group.
          * `countries` - (Optional) Specifies an array of two-letter ISO 3166 country codes, or for finer subdivisions, the two-letter country code and the two-letter stateOrProvince code separated by a forward slash.

        ## Schema reference

        You can download the GTM Geographic Map backing schema from the [Global Traffic Management API](https://developer.akamai.com/api/web_performance/global_traffic_management/v1.html#geographicmap) page.

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: GtmGeomapArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Use the `GtmGeomap` resource to create, configure, and import a GTM Geographic map. Geographic mapping lets you configure a property that returns a CNAME based on the geographic location of the request.

        You can reuse maps for multiple properties or create new ones. To configure a property for geographic mapping, you need to define at least one geographic map for your domain. Each map needs at least two definitions. For example, you can have one definition that maps a set of countries to a specific data center, and a second definition that routes all other traffic.

        > **Note** Import requires an ID with this format: `existing_domain_name`:`existing_map_name`.

        ## Example Usage

        Basic usage:

        ```python
        import pulumi
        import pulumi_akamai as akamai

        demo_geomap = akamai.GtmGeomap("demoGeomap",
            default_datacenter=akamai.GtmGeomapDefaultDatacenterArgs(
                datacenter_id=5400,
                nickname="All Others",
            ),
            domain="demo_domain.akadns.net")
        ```
        ## Argument reference

        This resource supports these arguments:

        * `domain` - (Required) GTM Domain name for the Geographic Map.
        * `name` - (Required) A descriptive label for the Geographic map.
        * `default_datacenter` - (Required) A placeholder for all other geographic zones. Requires these additional arguments:
          * `datacenter_id` - (Required) For each property, an identifier for all other geographic zones.
          * `nickname` - (Required) A descriptive label for all other geographic zones.
        * `wait_on_complete` - (Optional) A boolean indicating whether to wait for transaction to complete. Set to `true` by default.
        * `assignment` - (Optional) Contains information about the geographic zone groupings of countries. You can have multiple `assignment` arguments. If used, requires these additional arguments:
          * `datacenter_id` - (Optional) A unique identifier for an existing data center in the domain.
          * `nickname` - (Optional) A descriptive label for the group.
          * `countries` - (Optional) Specifies an array of two-letter ISO 3166 country codes, or for finer subdivisions, the two-letter country code and the two-letter stateOrProvince code separated by a forward slash.

        ## Schema reference

        You can download the GTM Geographic Map backing schema from the [Global Traffic Management API](https://developer.akamai.com/api/web_performance/global_traffic_management/v1.html#geographicmap) page.

        :param str resource_name: The name of the resource.
        :param GtmGeomapArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(GtmGeomapArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 assignments: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['GtmGeomapAssignmentArgs']]]]] = None,
                 default_datacenter: Optional[pulumi.Input[pulumi.InputType['GtmGeomapDefaultDatacenterArgs']]] = None,
                 domain: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 wait_on_complete: Optional[pulumi.Input[bool]] = None,
                 __props__=None):
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = _utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = GtmGeomapArgs.__new__(GtmGeomapArgs)

            __props__.__dict__["assignments"] = assignments
            if default_datacenter is None and not opts.urn:
                raise TypeError("Missing required property 'default_datacenter'")
            __props__.__dict__["default_datacenter"] = default_datacenter
            if domain is None and not opts.urn:
                raise TypeError("Missing required property 'domain'")
            __props__.__dict__["domain"] = domain
            __props__.__dict__["name"] = name
            __props__.__dict__["wait_on_complete"] = wait_on_complete
        alias_opts = pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="akamai:trafficmanagement/gtmGeomap:GtmGeomap")])
        opts = pulumi.ResourceOptions.merge(opts, alias_opts)
        super(GtmGeomap, __self__).__init__(
            'akamai:index/gtmGeomap:GtmGeomap',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            assignments: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['GtmGeomapAssignmentArgs']]]]] = None,
            default_datacenter: Optional[pulumi.Input[pulumi.InputType['GtmGeomapDefaultDatacenterArgs']]] = None,
            domain: Optional[pulumi.Input[str]] = None,
            name: Optional[pulumi.Input[str]] = None,
            wait_on_complete: Optional[pulumi.Input[bool]] = None) -> 'GtmGeomap':
        """
        Get an existing GtmGeomap resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _GtmGeomapState.__new__(_GtmGeomapState)

        __props__.__dict__["assignments"] = assignments
        __props__.__dict__["default_datacenter"] = default_datacenter
        __props__.__dict__["domain"] = domain
        __props__.__dict__["name"] = name
        __props__.__dict__["wait_on_complete"] = wait_on_complete
        return GtmGeomap(resource_name, opts=opts, __props__=__props__)

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

    @property
    @pulumi.getter(name="defaultDatacenter")
    def default_datacenter(self) -> pulumi.Output['outputs.GtmGeomapDefaultDatacenter']:
        return pulumi.get(self, "default_datacenter")

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

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

    @property
    @pulumi.getter(name="waitOnComplete")
    def wait_on_complete(self) -> pulumi.Output[Optional[bool]]:
        return pulumi.get(self, "wait_on_complete")

