# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

class GetEndpointResult:
    """
    A collection of values returned by getEndpoint.
    """
    def __init__(__self__, endpoint_region=None, id=None, interface=None, name=None, region=None, service_id=None, service_name=None, service_type=None, url=None):
        if endpoint_region and not isinstance(endpoint_region, str):
            raise TypeError("Expected argument 'endpoint_region' to be a str")
        __self__.endpoint_region = endpoint_region
        """
        See Argument Reference above.
        """
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        __self__.id = id
        """
        id is the provider-assigned unique ID for this managed resource.
        """
        if interface and not isinstance(interface, str):
            raise TypeError("Expected argument 'interface' to be a str")
        __self__.interface = interface
        """
        See Argument Reference above.
        """
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        __self__.name = name
        """
        See Argument Reference above.
        """
        if region and not isinstance(region, str):
            raise TypeError("Expected argument 'region' to be a str")
        __self__.region = region
        """
        See Argument Reference above.
        """
        if service_id and not isinstance(service_id, str):
            raise TypeError("Expected argument 'service_id' to be a str")
        __self__.service_id = service_id
        """
        See Argument Reference above.
        """
        if service_name and not isinstance(service_name, str):
            raise TypeError("Expected argument 'service_name' to be a str")
        __self__.service_name = service_name
        """
        See Argument Reference above.
        """
        if service_type and not isinstance(service_type, str):
            raise TypeError("Expected argument 'service_type' to be a str")
        __self__.service_type = service_type
        """
        See Argument Reference above.
        """
        if url and not isinstance(url, str):
            raise TypeError("Expected argument 'url' to be a str")
        __self__.url = url
        """
        The endpoint URL.
        """
class AwaitableGetEndpointResult(GetEndpointResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetEndpointResult(
            endpoint_region=self.endpoint_region,
            id=self.id,
            interface=self.interface,
            name=self.name,
            region=self.region,
            service_id=self.service_id,
            service_name=self.service_name,
            service_type=self.service_type,
            url=self.url)

def get_endpoint(endpoint_region=None,interface=None,name=None,region=None,service_id=None,service_name=None,service_type=None,opts=None):
    """
    Use this data source to get the ID of an OpenStack endpoint.

    > **Note:** This usually requires admin privileges.




    :param str endpoint_region: The region the endpoint is assigned to. The
           `region` and `endpoint_region` can be different.
    :param str interface: The endpoint interface. Valid values are `public`,
           `internal`, and `admin`. Default value is `public`
    :param str name: The name of the endpoint.
    :param str region: The region in which to obtain the V3 Keystone client.
           If omitted, the `region` argument of the provider is used.
    :param str service_id: The service id this endpoint belongs to.
    :param str service_name: The service name of the endpoint.
    :param str service_type: The service type of the endpoint.
    """
    __args__ = dict()


    __args__['endpointRegion'] = endpoint_region
    __args__['interface'] = interface
    __args__['name'] = name
    __args__['region'] = region
    __args__['serviceId'] = service_id
    __args__['serviceName'] = service_name
    __args__['serviceType'] = service_type
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('openstack:identity/getEndpoint:getEndpoint', __args__, opts=opts).value

    return AwaitableGetEndpointResult(
        endpoint_region=__ret__.get('endpointRegion'),
        id=__ret__.get('id'),
        interface=__ret__.get('interface'),
        name=__ret__.get('name'),
        region=__ret__.get('region'),
        service_id=__ret__.get('serviceId'),
        service_name=__ret__.get('serviceName'),
        service_type=__ret__.get('serviceType'),
        url=__ret__.get('url'))
