sevenbridges.meta package

Submodules

sevenbridges.meta.collection module

class sevenbridges.meta.collection.Collection(resource, href, total, items, links, api)[source]

Bases: list

Wrapper for SevenBridges pageable resources. Among the actual collection items it contains information regarding the total number of entries available in on the server and resource href.

all()[source]

Fetches all available items. :return: Collection object.

next_page()[source]

Fetches next result set. :return: Collection object.

previous_page()[source]

Fetches previous result set. :return: Collection object.

resource = None
total
class sevenbridges.meta.collection.VolumeCollection(href, items, links, prefixes, api)[source]

Bases: sevenbridges.meta.collection.Collection

next_page()[source]

Fetches next result set. :return: VolumeCollection object.

previous_page()[source]

Fetches previous result set. :return: Collection object.

total

sevenbridges.meta.comp_mutable_dict module

class sevenbridges.meta.comp_mutable_dict.CompoundMutableDict(**kwargs)[source]

Bases: dict

Resource used for mutable compound dictionaries.

equals(other)[source]
items() → a set-like object providing a view on D's items[source]
update([E, ]**F) → None. Update D from dict/iterable E and F.[source]

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

sevenbridges.meta.data module

class sevenbridges.meta.data.DataContainer(urls, api, parent)[source]

Bases: object

Utility for fetching data from the API server using, resource identifier or href.

fetch(item=None)[source]

sevenbridges.meta.fields module

class sevenbridges.meta.fields.BasicListField(read_only, name=None, max_length=None)[source]

Bases: sevenbridges.meta.fields.Field

validate(value)[source]
class sevenbridges.meta.fields.BooleanField(read_only, name=None)[source]

Bases: sevenbridges.meta.fields.Field

validate(value)[source]
class sevenbridges.meta.fields.CompoundField(cls, read_only, name=None, validator=None)[source]

Bases: sevenbridges.meta.fields.Field

class sevenbridges.meta.fields.CompoundListField(cls, read_only, name=None)[source]

Bases: sevenbridges.meta.fields.Field

class sevenbridges.meta.fields.DateTimeField(read_only, name=None)[source]

Bases: sevenbridges.meta.fields.Field

class sevenbridges.meta.fields.DictField(read_only, name=None)[source]

Bases: sevenbridges.meta.fields.Field, dict

class sevenbridges.meta.fields.Field(name=None, read_only=True, validator=None)[source]

Bases: object

EMPTY = <object object>
validate(value)[source]
class sevenbridges.meta.fields.FloatField(read_only, name=None)[source]

Bases: sevenbridges.meta.fields.Field

validate(value)[source]
class sevenbridges.meta.fields.HrefField(read_only, name=None)[source]

Bases: sevenbridges.meta.fields.Field

class sevenbridges.meta.fields.IntegerField(read_only, name=None)[source]

Bases: sevenbridges.meta.fields.Field

validate(value)[source]
class sevenbridges.meta.fields.ObjectIdField(read_only, name=None)[source]

Bases: sevenbridges.meta.fields.Field

class sevenbridges.meta.fields.StringField(read_only, name=None, max_length=None)[source]

Bases: sevenbridges.meta.fields.Field

validate(value)[source]
class sevenbridges.meta.fields.UuidField(read_only, name=None)[source]

Bases: sevenbridges.meta.fields.Field

validate(value)[source]

sevenbridges.meta.resource module

class sevenbridges.meta.resource.Resource(api, *args, **kwargs)[source]

Bases: object

Resource is base class for all resources, hiding implementation details of magic of injecting instance of API and common operations (like generic query).

delete()[source]

Deletes the resource on the server.

field(name)[source]

Return field value if it’s set :param name: Field name :return: Field value or None

classmethod get(id, api=None)[source]

Fetches the resource from the server. :param id: Resource identifier :param api: sevenbridges Api instance. :return: Resource object.

reload()[source]

Refreshes the resource with the data from the server.

update_old()[source]
class sevenbridges.meta.resource.ResourceMeta[source]

Bases: type

Metaclass for all resources, knows how to inject instance of API from class that contains classes with this meta. Class that contains this class has to have ‘api’ property which will be injected into class level API property of Resource class.

Creates constructors for all resources and manages instantiation of resource fields.

sevenbridges.meta.transformer module

class sevenbridges.meta.transformer.Transform[source]

Bases: object

static to_app(app)[source]

Serializes app to id string :param app: object to serialize :return: string id

static to_async_job(async_job)[source]
static to_automation(automation)[source]
static to_automation_member(member)[source]
static to_automation_package(package)[source]
static to_automation_run(automation_run)[source]
static to_billing_group(billing_group)[source]

Serializes billing_group to id string :param billing_group: object to serialize :return: string id

static to_dataset(dataset)[source]
static to_datestring(d)[source]

Serializes date to string :param d: object to serialize :return: string date

static to_division(division)[source]

Serializes division to id string :param division: object to serialize :return: string id

static to_export(export)[source]

Serializes export to id string :param export: object to serialize :return: string id

static to_file(file_)[source]

Serializes file to id string :param file_: object to serialize :return: string id

static to_import(import_)[source]

Serializes import to id string :param import_: object to serialize :return: string id

static to_location(location)[source]

Serializes location to string :param location: object to serialize :return: string

static to_marker(marker)[source]

Serializes marker to string :param marker: object to serialize :return: string id

static to_member(member)[source]
static to_project(project)[source]

Serializes project to id string :param project: object to serialize :return: string id

static to_resource(resource)[source]
static to_tags(tags)[source]
static to_task(task)[source]

Serializes task to id string :param task: object to serialize :return: string id

static to_team(team)[source]

Serializes team to id string :param team: object to serialize :return: string id

static to_user(user)[source]

Serializes user to id string :param user: object to serialize :return: string id

static to_volume(volume)[source]

Serializes volume to id string :param volume: object to serialize :return: string id