# 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__ = ['LoadbalancerArgs', 'Loadbalancer']

@pulumi.input_type
class LoadbalancerArgs:
    def __init__(__self__, *,
                 method: pulumi.Input[str],
                 rules: pulumi.Input[Sequence[pulumi.Input['LoadbalancerRuleArgs']]],
                 datacenter: Optional[pulumi.Input[str]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 health_check_interval: Optional[pulumi.Input[int]] = None,
                 health_check_path: Optional[pulumi.Input[str]] = None,
                 health_check_path_parser: Optional[pulumi.Input[str]] = None,
                 health_check_test: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 persistence: Optional[pulumi.Input[bool]] = None,
                 persistence_time: Optional[pulumi.Input[int]] = None):
        """
        The set of arguments for constructing a Loadbalancer resource.
        """
        pulumi.set(__self__, "method", method)
        pulumi.set(__self__, "rules", rules)
        if datacenter is not None:
            pulumi.set(__self__, "datacenter", datacenter)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if health_check_interval is not None:
            pulumi.set(__self__, "health_check_interval", health_check_interval)
        if health_check_path is not None:
            pulumi.set(__self__, "health_check_path", health_check_path)
        if health_check_path_parser is not None:
            pulumi.set(__self__, "health_check_path_parser", health_check_path_parser)
        if health_check_test is not None:
            pulumi.set(__self__, "health_check_test", health_check_test)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if persistence is not None:
            pulumi.set(__self__, "persistence", persistence)
        if persistence_time is not None:
            pulumi.set(__self__, "persistence_time", persistence_time)

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

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

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

    @rules.setter
    def rules(self, value: pulumi.Input[Sequence[pulumi.Input['LoadbalancerRuleArgs']]]):
        pulumi.set(self, "rules", value)

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

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

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

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

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

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

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

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

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

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

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

    @health_check_test.setter
    def health_check_test(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "health_check_test", 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
    def persistence(self) -> Optional[pulumi.Input[bool]]:
        return pulumi.get(self, "persistence")

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

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

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


@pulumi.input_type
class _LoadbalancerState:
    def __init__(__self__, *,
                 datacenter: Optional[pulumi.Input[str]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 health_check_interval: Optional[pulumi.Input[int]] = None,
                 health_check_path: Optional[pulumi.Input[str]] = None,
                 health_check_path_parser: Optional[pulumi.Input[str]] = None,
                 health_check_test: Optional[pulumi.Input[str]] = None,
                 method: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 persistence: Optional[pulumi.Input[bool]] = None,
                 persistence_time: Optional[pulumi.Input[int]] = None,
                 rules: Optional[pulumi.Input[Sequence[pulumi.Input['LoadbalancerRuleArgs']]]] = None):
        """
        Input properties used for looking up and filtering Loadbalancer resources.
        """
        if datacenter is not None:
            pulumi.set(__self__, "datacenter", datacenter)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if health_check_interval is not None:
            pulumi.set(__self__, "health_check_interval", health_check_interval)
        if health_check_path is not None:
            pulumi.set(__self__, "health_check_path", health_check_path)
        if health_check_path_parser is not None:
            pulumi.set(__self__, "health_check_path_parser", health_check_path_parser)
        if health_check_test is not None:
            pulumi.set(__self__, "health_check_test", health_check_test)
        if method is not None:
            pulumi.set(__self__, "method", method)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if persistence is not None:
            pulumi.set(__self__, "persistence", persistence)
        if persistence_time is not None:
            pulumi.set(__self__, "persistence_time", persistence_time)
        if rules is not None:
            pulumi.set(__self__, "rules", rules)

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

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

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

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

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

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

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

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

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

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

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

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

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

    @method.setter
    def method(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "method", 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
    def persistence(self) -> Optional[pulumi.Input[bool]]:
        return pulumi.get(self, "persistence")

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

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

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

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

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


class Loadbalancer(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 datacenter: Optional[pulumi.Input[str]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 health_check_interval: Optional[pulumi.Input[int]] = None,
                 health_check_path: Optional[pulumi.Input[str]] = None,
                 health_check_path_parser: Optional[pulumi.Input[str]] = None,
                 health_check_test: Optional[pulumi.Input[str]] = None,
                 method: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 persistence: Optional[pulumi.Input[bool]] = None,
                 persistence_time: Optional[pulumi.Input[int]] = None,
                 rules: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['LoadbalancerRuleArgs']]]]] = None,
                 __props__=None):
        """
        Create a Loadbalancer resource with the given unique name, props, and options.
        :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: LoadbalancerArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Create a Loadbalancer resource with the given unique name, props, and options.
        :param str resource_name: The name of the resource.
        :param LoadbalancerArgs 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(LoadbalancerArgs, 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,
                 datacenter: Optional[pulumi.Input[str]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 health_check_interval: Optional[pulumi.Input[int]] = None,
                 health_check_path: Optional[pulumi.Input[str]] = None,
                 health_check_path_parser: Optional[pulumi.Input[str]] = None,
                 health_check_test: Optional[pulumi.Input[str]] = None,
                 method: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 persistence: Optional[pulumi.Input[bool]] = None,
                 persistence_time: Optional[pulumi.Input[int]] = None,
                 rules: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['LoadbalancerRuleArgs']]]]] = 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__ = LoadbalancerArgs.__new__(LoadbalancerArgs)

            __props__.__dict__["datacenter"] = datacenter
            __props__.__dict__["description"] = description
            __props__.__dict__["health_check_interval"] = health_check_interval
            __props__.__dict__["health_check_path"] = health_check_path
            __props__.__dict__["health_check_path_parser"] = health_check_path_parser
            __props__.__dict__["health_check_test"] = health_check_test
            if method is None and not opts.urn:
                raise TypeError("Missing required property 'method'")
            __props__.__dict__["method"] = method
            __props__.__dict__["name"] = name
            __props__.__dict__["persistence"] = persistence
            __props__.__dict__["persistence_time"] = persistence_time
            if rules is None and not opts.urn:
                raise TypeError("Missing required property 'rules'")
            __props__.__dict__["rules"] = rules
        super(Loadbalancer, __self__).__init__(
            'oneandone:index/loadbalancer:Loadbalancer',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            datacenter: Optional[pulumi.Input[str]] = None,
            description: Optional[pulumi.Input[str]] = None,
            health_check_interval: Optional[pulumi.Input[int]] = None,
            health_check_path: Optional[pulumi.Input[str]] = None,
            health_check_path_parser: Optional[pulumi.Input[str]] = None,
            health_check_test: Optional[pulumi.Input[str]] = None,
            method: Optional[pulumi.Input[str]] = None,
            name: Optional[pulumi.Input[str]] = None,
            persistence: Optional[pulumi.Input[bool]] = None,
            persistence_time: Optional[pulumi.Input[int]] = None,
            rules: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['LoadbalancerRuleArgs']]]]] = None) -> 'Loadbalancer':
        """
        Get an existing Loadbalancer 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__ = _LoadbalancerState.__new__(_LoadbalancerState)

        __props__.__dict__["datacenter"] = datacenter
        __props__.__dict__["description"] = description
        __props__.__dict__["health_check_interval"] = health_check_interval
        __props__.__dict__["health_check_path"] = health_check_path
        __props__.__dict__["health_check_path_parser"] = health_check_path_parser
        __props__.__dict__["health_check_test"] = health_check_test
        __props__.__dict__["method"] = method
        __props__.__dict__["name"] = name
        __props__.__dict__["persistence"] = persistence
        __props__.__dict__["persistence_time"] = persistence_time
        __props__.__dict__["rules"] = rules
        return Loadbalancer(resource_name, opts=opts, __props__=__props__)

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

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

    @property
    @pulumi.getter(name="healthCheckInterval")
    def health_check_interval(self) -> pulumi.Output[Optional[int]]:
        return pulumi.get(self, "health_check_interval")

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

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

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

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

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

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

    @property
    @pulumi.getter(name="persistenceTime")
    def persistence_time(self) -> pulumi.Output[Optional[int]]:
        return pulumi.get(self, "persistence_time")

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

