def METHOD_NAME(endpoint_name: Optional[str] = None,
                              expiresin: Optional[int] = None,
                              resource_uri: Optional[str] = None,
                              service_name: Optional[Union[str, 'ServiceName']] = None,
                              opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableListEndpointCredentialsResult:
    """
    Gets the endpoint access credentials to the resource.
    Azure REST API version: 2023-03-15.
    :param str endpoint_name: The endpoint name.
    :param int expiresin: The is how long the endpoint access token is valid (in seconds).
    :param str resource_uri: The fully qualified Azure Resource manager identifier of the resource to be connected.
    :param Union[str, 'ServiceName'] service_name: The name of the service. If not provided, the request will by pass the generation of service configuration token 
    """
    __args__ = dict()
    __args__['endpointName'] = endpoint_name
    __args__['expiresin'] = expiresin
    __args__['resourceUri'] = resource_uri
    __args__['serviceName'] = service_name
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('azure-native:hybridconnectivity:listEndpointCredentials', __args__, opts=opts, typ=ListEndpointCredentialsResult).value
    return AwaitableListEndpointCredentialsResult(
        access_key=pulumi.get(__ret__, 'access_key'),
        expires_on=pulumi.get(__ret__, 'expires_on'),
        hybrid_connection_name=pulumi.get(__ret__, 'hybrid_connection_name'),
        namespace_name=pulumi.get(__ret__, 'namespace_name'),
        namespace_name_suffix=pulumi.get(__ret__, 'namespace_name_suffix'),
        service_configuration_token=pulumi.get(__ret__, 'service_configuration_token'))