EDataServer.OAuth2Services.guess

### Method

# EDataServer OAuth2Servicesguess

since: 3.28

#### Declaration [src]

    EOAuth2Service*
    e_oauth2_services_guess (
      EOAuth2Services* services,
      const gchar* protocol,
      const gchar* hostname
    )

#### Description [src]

Searches the list of currently known OAuth2 services for the one which can be used with the given `protocol` and/or `hostname`. Any of `protocol` and `hostname` can be `NULL`, but not both. It’s up to each `EOAuth2Service` to decide, which of the arguments are important and whether all or only any of them can be required.

The returned `EOAuth2Service` is referenced for thread safety, if found.

Available since: 3.28

#### Parameters

`protocol`

  Type: `const gchar*`

  A protocol to search the service for, like “imap”, or `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`hostname`

  Type: `const gchar*`

  A host name to search the service for, like “server.example.com”, or `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

#### Return value

Type: `EOAuth2Service`

A referenced `EOAuth2Service`, which can be used with given constraints, or `NULL`, when none was found.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.
The return value can be `NULL`.