# 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 sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities

__all__ = ['NetworkingIpArgs', 'NetworkingIp']

@pulumi.input_type
class NetworkingIpArgs:
    def __init__(__self__, *,
                 linode_id: Optional[pulumi.Input[int]] = None,
                 public: Optional[pulumi.Input[bool]] = None,
                 region: Optional[pulumi.Input[str]] = None,
                 reserved: Optional[pulumi.Input[bool]] = None,
                 type: Optional[pulumi.Input[str]] = None):
        """
        The set of arguments for constructing a NetworkingIp resource.
        :param pulumi.Input[int] linode_id: The ID of the Linode to allocate an IPv4 address for. Required when reserved is false or not set.
        :param pulumi.Input[bool] public: Whether the IPv4 address is public or private.
        :param pulumi.Input[str] region: The region for the reserved IPv4 address. Required when reserved is true and linode_id is not set.
        :param pulumi.Input[bool] reserved: Whether the IPv4 address should be reserved.
        :param pulumi.Input[str] type: The type of IP address (ipv4).
        """
        if linode_id is not None:
            pulumi.set(__self__, "linode_id", linode_id)
        if public is not None:
            pulumi.set(__self__, "public", public)
        if region is not None:
            pulumi.set(__self__, "region", region)
        if reserved is not None:
            pulumi.set(__self__, "reserved", reserved)
        if type is not None:
            pulumi.set(__self__, "type", type)

    @property
    @pulumi.getter(name="linodeId")
    def linode_id(self) -> Optional[pulumi.Input[int]]:
        """
        The ID of the Linode to allocate an IPv4 address for. Required when reserved is false or not set.
        """
        return pulumi.get(self, "linode_id")

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

    @property
    @pulumi.getter
    def public(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether the IPv4 address is public or private.
        """
        return pulumi.get(self, "public")

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

    @property
    @pulumi.getter
    def region(self) -> Optional[pulumi.Input[str]]:
        """
        The region for the reserved IPv4 address. Required when reserved is true and linode_id is not set.
        """
        return pulumi.get(self, "region")

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

    @property
    @pulumi.getter
    def reserved(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether the IPv4 address should be reserved.
        """
        return pulumi.get(self, "reserved")

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

    @property
    @pulumi.getter
    def type(self) -> Optional[pulumi.Input[str]]:
        """
        The type of IP address (ipv4).
        """
        return pulumi.get(self, "type")

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


@pulumi.input_type
class _NetworkingIpState:
    def __init__(__self__, *,
                 address: Optional[pulumi.Input[str]] = None,
                 linode_id: Optional[pulumi.Input[int]] = None,
                 public: Optional[pulumi.Input[bool]] = None,
                 region: Optional[pulumi.Input[str]] = None,
                 reserved: Optional[pulumi.Input[bool]] = None,
                 type: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering NetworkingIp resources.
        :param pulumi.Input[str] address: The allocated IPv4 address.
        :param pulumi.Input[int] linode_id: The ID of the Linode to allocate an IPv4 address for. Required when reserved is false or not set.
        :param pulumi.Input[bool] public: Whether the IPv4 address is public or private.
        :param pulumi.Input[str] region: The region for the reserved IPv4 address. Required when reserved is true and linode_id is not set.
        :param pulumi.Input[bool] reserved: Whether the IPv4 address should be reserved.
        :param pulumi.Input[str] type: The type of IP address (ipv4).
        """
        if address is not None:
            pulumi.set(__self__, "address", address)
        if linode_id is not None:
            pulumi.set(__self__, "linode_id", linode_id)
        if public is not None:
            pulumi.set(__self__, "public", public)
        if region is not None:
            pulumi.set(__self__, "region", region)
        if reserved is not None:
            pulumi.set(__self__, "reserved", reserved)
        if type is not None:
            pulumi.set(__self__, "type", type)

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

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

    @property
    @pulumi.getter(name="linodeId")
    def linode_id(self) -> Optional[pulumi.Input[int]]:
        """
        The ID of the Linode to allocate an IPv4 address for. Required when reserved is false or not set.
        """
        return pulumi.get(self, "linode_id")

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

    @property
    @pulumi.getter
    def public(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether the IPv4 address is public or private.
        """
        return pulumi.get(self, "public")

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

    @property
    @pulumi.getter
    def region(self) -> Optional[pulumi.Input[str]]:
        """
        The region for the reserved IPv4 address. Required when reserved is true and linode_id is not set.
        """
        return pulumi.get(self, "region")

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

    @property
    @pulumi.getter
    def reserved(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether the IPv4 address should be reserved.
        """
        return pulumi.get(self, "reserved")

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

    @property
    @pulumi.getter
    def type(self) -> Optional[pulumi.Input[str]]:
        """
        The type of IP address (ipv4).
        """
        return pulumi.get(self, "type")

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


class NetworkingIp(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 linode_id: Optional[pulumi.Input[int]] = None,
                 public: Optional[pulumi.Input[bool]] = None,
                 region: Optional[pulumi.Input[str]] = None,
                 reserved: Optional[pulumi.Input[bool]] = None,
                 type: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Create a NetworkingIp 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.
        :param pulumi.Input[int] linode_id: The ID of the Linode to allocate an IPv4 address for. Required when reserved is false or not set.
        :param pulumi.Input[bool] public: Whether the IPv4 address is public or private.
        :param pulumi.Input[str] region: The region for the reserved IPv4 address. Required when reserved is true and linode_id is not set.
        :param pulumi.Input[bool] reserved: Whether the IPv4 address should be reserved.
        :param pulumi.Input[str] type: The type of IP address (ipv4).
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: Optional[NetworkingIpArgs] = None,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Create a NetworkingIp resource with the given unique name, props, and options.
        :param str resource_name: The name of the resource.
        :param NetworkingIpArgs 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(NetworkingIpArgs, 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,
                 linode_id: Optional[pulumi.Input[int]] = None,
                 public: Optional[pulumi.Input[bool]] = None,
                 region: Optional[pulumi.Input[str]] = None,
                 reserved: Optional[pulumi.Input[bool]] = None,
                 type: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        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__ = NetworkingIpArgs.__new__(NetworkingIpArgs)

            __props__.__dict__["linode_id"] = linode_id
            __props__.__dict__["public"] = public
            __props__.__dict__["region"] = region
            __props__.__dict__["reserved"] = reserved
            __props__.__dict__["type"] = type
            __props__.__dict__["address"] = None
        super(NetworkingIp, __self__).__init__(
            'linode:index/networkingIp:NetworkingIp',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            address: Optional[pulumi.Input[str]] = None,
            linode_id: Optional[pulumi.Input[int]] = None,
            public: Optional[pulumi.Input[bool]] = None,
            region: Optional[pulumi.Input[str]] = None,
            reserved: Optional[pulumi.Input[bool]] = None,
            type: Optional[pulumi.Input[str]] = None) -> 'NetworkingIp':
        """
        Get an existing NetworkingIp 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.
        :param pulumi.Input[str] address: The allocated IPv4 address.
        :param pulumi.Input[int] linode_id: The ID of the Linode to allocate an IPv4 address for. Required when reserved is false or not set.
        :param pulumi.Input[bool] public: Whether the IPv4 address is public or private.
        :param pulumi.Input[str] region: The region for the reserved IPv4 address. Required when reserved is true and linode_id is not set.
        :param pulumi.Input[bool] reserved: Whether the IPv4 address should be reserved.
        :param pulumi.Input[str] type: The type of IP address (ipv4).
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _NetworkingIpState.__new__(_NetworkingIpState)

        __props__.__dict__["address"] = address
        __props__.__dict__["linode_id"] = linode_id
        __props__.__dict__["public"] = public
        __props__.__dict__["region"] = region
        __props__.__dict__["reserved"] = reserved
        __props__.__dict__["type"] = type
        return NetworkingIp(resource_name, opts=opts, __props__=__props__)

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

    @property
    @pulumi.getter(name="linodeId")
    def linode_id(self) -> pulumi.Output[int]:
        """
        The ID of the Linode to allocate an IPv4 address for. Required when reserved is false or not set.
        """
        return pulumi.get(self, "linode_id")

    @property
    @pulumi.getter
    def public(self) -> pulumi.Output[bool]:
        """
        Whether the IPv4 address is public or private.
        """
        return pulumi.get(self, "public")

    @property
    @pulumi.getter
    def region(self) -> pulumi.Output[str]:
        """
        The region for the reserved IPv4 address. Required when reserved is true and linode_id is not set.
        """
        return pulumi.get(self, "region")

    @property
    @pulumi.getter
    def reserved(self) -> pulumi.Output[bool]:
        """
        Whether the IPv4 address should be reserved.
        """
        return pulumi.get(self, "reserved")

    @property
    @pulumi.getter
    def type(self) -> pulumi.Output[str]:
        """
        The type of IP address (ipv4).
        """
        return pulumi.get(self, "type")

