from marshmallow import fields, Schema
from pystac.models.geojson_type import GeojsonType
from pystac.models.item import ItemSchema
from pystac.models.base import STACObject


class Collection(STACObject):

    def __init__(self, features, collection_id):
        """STAC Catalog item collection

        Args:
            features (List[Item]):
        """
        self.features = features
        self.id = collection_id

    @property
    def type(self):
        return GeojsonType.FeatureCollection.value

    @property
    def dict(self):
        return dict(type=self.type, id=self.id, features=[feature.dict for
            feature in self.features])

    @property
    def json(self):
        return CollectionSchema().dumps(self)


class CollectionSchema(Schema):
    type = fields.Str()
    id = fields.Str()
    features = fields.Nested(ItemSchema, many=True)

31b435811c847b4f6ef3701ed7b134ce26df3bc2
<mask token>


class Collection(STACObject):
    <mask token>
    <mask token>
    <mask token>

    @property
    def json(self):
        return CollectionSchema().dumps(self)


class CollectionSchema(Schema):
    type = fields.Str()
    id = fields.Str()
    features = fields.Nested(ItemSchema, many=True)

<mask token>


class Collection(STACObject):
    <mask token>

    @property
    def type(self):
        return GeojsonType.FeatureCollection.value
    <mask token>

    @property
    def json(self):
        return CollectionSchema().dumps(self)


class CollectionSchema(Schema):
    type = fields.Str()
    id = fields.Str()
    features = fields.Nested(ItemSchema, many=True)

<mask token>


class Collection(STACObject):

    def __init__(self, features, collection_id):
        """STAC Catalog item collection

        Args:
            features (List[Item]):
        """
        self.features = features
        self.id = collection_id

    @property
    def type(self):
        return GeojsonType.FeatureCollection.value
    <mask token>

    @property
    def json(self):
        return CollectionSchema().dumps(self)


class CollectionSchema(Schema):
    type = fields.Str()
    id = fields.Str()
    features = fields.Nested(ItemSchema, many=True)

from marshmallow import fields, Schema
from pystac.models.geojson_type import GeojsonType
from pystac.models.item import ItemSchema
from pystac.models.base import STACObject


class Collection(STACObject):

    def __init__(self, features, collection_id):
        """STAC Catalog item collection

        Args:
            features (List[Item]):
        """
        self.features = features
        self.id = collection_id

    @property
    def type(self):
        return GeojsonType.FeatureCollection.value

    @property
    def dict(self):
        return dict(type=self.type, id=self.id, features=[feature.dict for
            feature in self.features])

    @property
    def json(self):
        return CollectionSchema().dumps(self)


class CollectionSchema(Schema):
    type = fields.Str()
    id = fields.Str()
    features = fields.Nested(ItemSchema, many=True)
