<commit_before>.. _rocketfuel:

==========
Rocketfuel
==========

Rocketfuel is the consumer client for the Marketplace Publishing Tool. It has some special APIs that are *not recommended* for consumption by other clients.

These APIs will change in conjunction with the Rocketfuel client.


Collections
===========

A collection is a group of applications


Listing
-------

.. http:get:: /api/v1/rocketfuel/collections/

    A listing of all collections.

    .. note:: Authentication is optional.

    **Request**:

    :param category: a category ID.
    :type category: int
    :param region: a region ID.
    :type region: int
    :param carrier: a carrier ID.
    :type carrier: int

Create
------

.. http:post:: /api/v1/rocketfuel/collections/

    Create a collection.

    .. note:: Authentication is required.

    **Request**:

    :param collection_type: the type of collection to create.
    :type collection_type: int
    :param name: the name of the collection. Can be a dict, in which case keys are locales and values are each a translation for the corresponding locale.
    :type name: string|dict
    :param description: a description of the collection. Can be a dict, in which case keys are locales and values are each a translation for the corresponding locale.
    :type description: string|dict
    :param category: the ID of the category to attach this collection to. Defaults to ``null``.
    :type collection_type: int|null
    :param region: the ID of the region to attach this collection to. Defaults to ``null``.
    :type region: int|null
    :param carrier: the ID of the carrier to attach this collection to. Defaults to ``null``.
    :type carrier: int|null
    :param author: the author of the collection.
    :type author: string

Detail
------

.. http:get:: /api/v1/rocketfuel/collections/(int:id)/

    Get a single collection.

    .. note:: Authentication is optional.


Update
------

.. http:patch:: /api/v1/rocketfuel/collections/(int:id)/

    Update a collection.

    .. note:: Authentication is required.

    **Request**:

    :param collection_type: the type of the collection.
    :type collection_type: int
    :param name: the name of the collection. Can be a dict, in which case keys are locales and values are each a translation for the corresponding locale.
    :type name: string|dict
    :param description: a description of the collection. Can be a dict, in which case keys are locales and values are each a translation for the corresponding locale.
    :type description: string|dict
    :param category: the ID of the category to attach this collection to.
    :type collection_type: int|null
    :param region: the ID of the region to attach this collection to.
    :type region: int|null
    :param carrier: the ID of the carrier to attach this collection to.
    :type carrier: int|null
    :param author: the author of the collection.
    :type author: string

    **Response**:

    A representation of the updated collection will be returned in the response
    body.

    :status 200: collection successfully updated.
    :status 400: invalid request; more details provided in the response body.


Add Apps
--------

.. http:post:: /api/v1/rocketfuel/collections/(int:id)/add_app/

    Add an application to a single collection.

    .. note:: Authentication is required.

    **Request**:
<commit_msg>Fix typo in the rocketfuel docs<commit_after>.. _rocketfuel:

==========
Rocketfuel
==========

Rocketfuel is the consumer client for the Marketplace Publishing Tool. It has some special APIs that are *not recommended* for consumption by other clients.

These APIs will change in conjunction with the Rocketfuel client.


Collections
===========

A collection is a group of applications


Listing
-------

.. http:get:: /api/v1/rocketfuel/collections/

    A listing of all collections.

    .. note:: Authentication is optional.

    **Request**:

    :param category: a category ID.
    :type category: int
    :param region: a region ID.
    :type region: int
    :param carrier: a carrier ID.
    :type carrier: int

Create
------

.. http:post:: /api/v1/rocketfuel/collections/

    Create a collection.

    .. note:: Authentication is required.

    **Request**:

    :param collection_type: the type of collection to create.
    :type collection_type: int
    :param name: the name of the collection. Can be a dict, in which case keys are locales and values are each a translation for the corresponding locale.
    :type name: string|dict
    :param description: a description of the collection. Can be a dict, in which case keys are locales and values are each a translation for the corresponding locale.
    :type description: string|dict
    :param category: the ID of the category to attach this collection to. Defaults to ``null``.
    :type category: int|null
    :param region: the ID of the region to attach this collection to. Defaults to ``null``.
    :type region: int|null
    :param carrier: the ID of the carrier to attach this collection to. Defaults to ``null``.
    :type carrier: int|null
    :param author: the author of the collection.
    :type author: string

Detail
------

.. http:get:: /api/v1/rocketfuel/collections/(int:id)/

    Get a single collection.

    .. note:: Authentication is optional.


Update
------

.. http:patch:: /api/v1/rocketfuel/collections/(int:id)/

    Update a collection.

    .. note:: Authentication is required.

    **Request**:

    :param collection_type: the type of the collection.
    :type collection_type: int
    :param name: the name of the collection. Can be a dict, in which case keys are locales and values are each a translation for the corresponding locale.
    :type name: string|dict
    :param description: a description of the collection. Can be a dict, in which case keys are locales and values are each a translation for the corresponding locale.
    :type description: string|dict
    :param category: the ID of the category to attach this collection to.
    :type category: int|null
    :param region: the ID of the region to attach this collection to.
    :type region: int|null
    :param carrier: the ID of the carrier to attach this collection to.
    :type carrier: int|null
    :param author: the author of the collection.
    :type author: string

    **Response**:

    A representation of the updated collection will be returned in the response
    body.

    :status 200: collection successfully updated.
    :status 400: invalid request; more details provided in the response body.


Add Apps
--------

.. http:post:: /api/v1/rocketfuel/collections/(int:id)/add_app/

    Add an application to a single collection.

    .. note:: Authentication is required.

    **Request**:

{'fraction_non_alphanumeric': 0.09460260972716489, 'fraction_numerical': 0.003262158956109134, 'mean_word_length': 3.127906976744186, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4497161', 'n_tokens_mistral': 1857, 'n_tokens_neox': 1761, 'n_words': 847}