librest Reference Manual: LastfmProxy

## LastfmProxy LastfmProxy |

## Functions

RestProxy * | lastfm_proxy_new ()
RestProxy * | lastfm_proxy_new_with_session ()
const char * | lastfm_proxy_get_api_key ()
const char * | lastfm_proxy_get_secret ()
const char * | lastfm_proxy_get_session_key ()
void | lastfm_proxy_set_session_key ()
char * | lastfm_proxy_sign ()
char * | lastfm_proxy_build_login_url ()
gboolean | lastfm_proxy_is_successful ()

## Properties

gchar * | api-key | Read / Write / Construct Only
gchar * | secret | Read / Write / Construct Only
gchar * | session-key | Read / Write

## Types and Values

| LastfmProxy
#define | LASTFM_PROXY_ERROR

## Object Hierarchy

        GObject
        ╰── RestProxy
            ╰── LastfmProxy

## Description

## Functions

### lastfm_proxy_new ()

    RestProxy *
    lastfm_proxy_new (const char *api_key,
                      const char *secret);

### lastfm_proxy_new_with_session ()

    RestProxy *
    lastfm_proxy_new_with_session (const char *api_key,
                                   const char *secret,
                                   const char *session_key);

### lastfm_proxy_get_api_key ()

    const char *
    lastfm_proxy_get_api_key (LastfmProxy *proxy);

Get the API key.

#### Parameters

proxy | an LastfmProxy |

#### Returns

the API key. This string is owned by LastfmProxy and should not be freed.

### lastfm_proxy_get_secret ()

    const char *
    lastfm_proxy_get_secret (LastfmProxy *proxy);

Get the secret for authentication.

#### Parameters

proxy | an LastfmProxy |

#### Returns

the secret. This string is owned by LastfmProxy and should not be freed.

### lastfm_proxy_get_session_key ()

    const char *
    lastfm_proxy_get_session_key (LastfmProxy *proxy);

Get the current session key.

#### Parameters

proxy | an LastfmProxy |

#### Returns

the session key, or `NULL` if there is no session key yet. This string is owned by LastfmProxy and should not be freed.

### lastfm_proxy_set_session_key ()

    void
    lastfm_proxy_set_session_key (LastfmProxy *proxy,
                                  const char *session_key);

Set the session key.

#### Parameters

proxy | an LastfmProxy |
session_key | the access session_key |

### lastfm_proxy_sign ()

    char *
    lastfm_proxy_sign (LastfmProxy *proxy,
                       GHashTable *params);

### lastfm_proxy_build_login_url ()

    char *
    lastfm_proxy_build_login_url (LastfmProxy *proxy,
                                  const char *token);

### lastfm_proxy_is_successful ()

    gboolean
    lastfm_proxy_is_successful (RestXmlNode *root,
                                GError **error);

Examines the Lastfm response and if it not a successful reply, set `error` and return FALSE.

#### Parameters

root | The root node of a parsed Lastfm response |
error | GError to set if the response was an error |

#### Returns

`TRUE` if this response is successful, `FALSE` otherwise.

## Types and Values

### LastfmProxy

    typedef struct _LastfmProxy LastfmProxy;

LastfmProxy has no publicly available members.

### LASTFM_PROXY_ERROR

    #define LASTFM_PROXY_ERROR lastfm_proxy_error_quark()

## Property Details

### The `“api-key”` property

      “api-key”                  gchar *

The API key.

Flags: Read / Write / Construct Only

Default value: NULL

### The `“secret”` property

      “secret”                   gchar *

The API key secret.

Flags: Read / Write / Construct Only

Default value: NULL

### The `“session-key”` property

      “session-key”              gchar *

The session key.

Flags: Read / Write

Default value: NULL