# musicdb-client
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: 1.0.1
- Package version: 1.0.3
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen

## Requirements.

Python 2.7 and 3.4+

## Installation & Usage
### pip install

If the python package is hosted on Github, you can install directly from Github

```sh
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)

Then import the package:
```python
import musicdb_client 
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import musicdb_client
```

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python
from __future__ import print_function
import time
import musicdb_client
from musicdb_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: oauth2
configuration = musicdb_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = musicdb_client.PublicApi(musicdb_client.ApiClient(configuration))
body = musicdb_client.Album() # Album | The album to create.

try:
    # Creates a new album.
    api_instance.api_albums_create_album(body)
except ApiException as e:
    print("Exception when calling PublicApi->api_albums_create_album: %s\n" % e)

# Configure OAuth2 access token for authorization: oauth2
configuration = musicdb_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = musicdb_client.PublicApi(musicdb_client.ApiClient(configuration))
album_id = 56 # int | The album id to delete.

try:
    # Deletes an album.
    api_instance.api_albums_delete_album(album_id)
except ApiException as e:
    print("Exception when calling PublicApi->api_albums_delete_album: %s\n" % e)

# Configure OAuth2 access token for authorization: oauth2
configuration = musicdb_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = musicdb_client.PublicApi(musicdb_client.ApiClient(configuration))
quantity = 56 # int | Number of random albums to get. If not indicated it will return all albums. (optional)
album_id = 56 # int | Id of album to get. If this parameter is set the parameter quantity will not be checked. (optional)

try:
    # Fetch albums from the music database
    api_response = api_instance.api_albums_get_albums(quantity=quantity, album_id=album_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PublicApi->api_albums_get_albums: %s\n" % e)

# Configure OAuth2 access token for authorization: oauth2
configuration = musicdb_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = musicdb_client.PublicApi(musicdb_client.ApiClient(configuration))
body = musicdb_client.Album() # Album | The album to update.

try:
    # Updates an album.
    api_instance.api_albums_update_album(body)
except ApiException as e:
    print("Exception when calling PublicApi->api_albums_update_album: %s\n" % e)

# Configure OAuth2 access token for authorization: oauth2
configuration = musicdb_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = musicdb_client.PublicApi(musicdb_client.ApiClient(configuration))

try:
    # Rootpath get for supporting health check on GKE
    api_instance.api_generic_get()
except ApiException as e:
    print("Exception when calling PublicApi->api_generic_get: %s\n" % e)

# Configure OAuth2 access token for authorization: oauth2
configuration = musicdb_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = musicdb_client.PublicApi(musicdb_client.ApiClient(configuration))
body = musicdb_client.Song() # Song | The song to create.

try:
    # Creates a new favorite song.
    api_instance.api_songs_create_song(body)
except ApiException as e:
    print("Exception when calling PublicApi->api_songs_create_song: %s\n" % e)

# Configure OAuth2 access token for authorization: oauth2
configuration = musicdb_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = musicdb_client.PublicApi(musicdb_client.ApiClient(configuration))
song_id = 56 # int | The song id to delete.

try:
    # Deletes a favorite song.
    api_instance.api_songs_delete_song(song_id)
except ApiException as e:
    print("Exception when calling PublicApi->api_songs_delete_song: %s\n" % e)

# Configure OAuth2 access token for authorization: oauth2
configuration = musicdb_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = musicdb_client.PublicApi(musicdb_client.ApiClient(configuration))
quantity = 56 # int | Number of favorite songs to get. If not indicated it will return all songs (if there is at least one song matching the score criteria). (optional)
score = 1.2 # float | Minimum score of the favorite songs to get. If not indicated it will return all songs. (optional)

try:
    # Fetch random songs from the favorites database
    api_response = api_instance.api_songs_get_songs(quantity=quantity, score=score)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PublicApi->api_songs_get_songs: %s\n" % e)

# Configure OAuth2 access token for authorization: oauth2
configuration = musicdb_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = musicdb_client.PublicApi(musicdb_client.ApiClient(configuration))
body = musicdb_client.Song() # Song | The song to update.

try:
    # Updates a favorite song.
    api_instance.api_songs_update_song(body)
except ApiException as e:
    print("Exception when calling PublicApi->api_songs_update_song: %s\n" % e)
```

## Documentation for API Endpoints

All URIs are relative to */*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*PublicApi* | [**api_albums_create_album**](docs/PublicApi.md#api_albums_create_album) | **POST** /music/albums | Creates a new album.
*PublicApi* | [**api_albums_delete_album**](docs/PublicApi.md#api_albums_delete_album) | **DELETE** /music/albums | Deletes an album.
*PublicApi* | [**api_albums_get_albums**](docs/PublicApi.md#api_albums_get_albums) | **GET** /music/albums | Fetch albums from the music database
*PublicApi* | [**api_albums_update_album**](docs/PublicApi.md#api_albums_update_album) | **PUT** /music/albums | Updates an album.
*PublicApi* | [**api_generic_get**](docs/PublicApi.md#api_generic_get) | **GET** / | Rootpath get for supporting health check on GKE
*PublicApi* | [**api_songs_create_song**](docs/PublicApi.md#api_songs_create_song) | **POST** /music/fav_songs | Creates a new favorite song.
*PublicApi* | [**api_songs_delete_song**](docs/PublicApi.md#api_songs_delete_song) | **DELETE** /music/fav_songs | Deletes a favorite song.
*PublicApi* | [**api_songs_get_songs**](docs/PublicApi.md#api_songs_get_songs) | **GET** /music/fav_songs | Fetch random songs from the favorites database
*PublicApi* | [**api_songs_update_song**](docs/PublicApi.md#api_songs_update_song) | **PUT** /music/fav_songs | Updates a favorite song.

## Documentation For Models

 - [Album](docs/Album.md)
 - [InlineResponse200](docs/InlineResponse200.md)
 - [Song](docs/Song.md)

## Documentation For Authorization


## oauth2

- **Type**: OAuth
- **Flow**: implicit
- **Authorization URL**: https://example.com/oauth2/dialog
- **Scopes**: 
 - ****: 


## Author


