craft_store.models package

Submodules

Module contents

Models package for store responses.

craft_store.models.CharmListReleasesModel

alias of craft_store.models.charm_list_releases_model.ListReleasesModel

class craft_store.models.MarshableModel(**data)[source]

Bases: pydantic.main.BaseModel

A BaseModel that can be marshaled and unmarshaled.

Parameters

data (Any) –

class Config[source]

Bases: object

Pydantic model configuration.

alias_generator()
allow_mutation = False
validate_assignment = True
marshal()[source]

Create a dictionary containing the part specification data.

Return type

Dict[str, Any]

Returns

The newly created dictionary.

classmethod unmarshal(data)[source]

Create and populate a new MarshableModel from a dict.

The unmarshal method validates entries in the input dictionary, populating the corresponding fields in the data object.

Parameters

data (Dict[str, Any]) – The dictionary data to unmarshal.

Return type

MarshableModel

Returns

The newly created object.

Raises

TypeError – If data is not a dictionary.

class craft_store.models.ReleaseRequestModel(**data)[source]

Bases: craft_store.models._base_model.MarshableModel

Model to request a release to the store.

Parameters
  • channel – name of the channel to release to.

  • resources – resources to release with this revision.

  • revision – revision to release.

  • data (Any) –

channel: str
resources: Optional[List[craft_store.models.release_request_model.ResourceModel]]
revision: Optional[int]
class craft_store.models.RevisionsRequestModel(**data)[source]

Bases: craft_store.models._base_model.MarshableModel

Resource model for a ReleaseRequestModel.

Parameters
  • upload_id – the upload-id returned from the storage endpoint.

  • data (Any) –

upload_id: str
class craft_store.models.RevisionsResponseModel(**data)[source]

Bases: craft_store.models._base_model.MarshableModel

Model for a revisions response.

Parameters
  • status-url – a URL to monitor the state of the posted revision.

  • data (Any) –

status_url: str
craft_store.models.SnapListReleasesModel

alias of craft_store.models.snap_list_releases_model.ListReleasesModel