Models

Tugboat’s models are light-weight classes which contain attributes of the objects on the server they represent. There are no instance methods and each class only has one static method (createFromDict) which accepts a dictionary and tries to instantiate an object from it.

class tugboatyards.Page(page_id=0, offers=[])

A Page object represents a publisher’s Tugboat Page.

attribute type
page_id Integer
offers List of tugboatyards.Offer objects.
class tugboatyards.Issue(issue_name='', title='')

A Issue contains information about an individual issue attached to an Offer. Only offers of type “magazine” can have issues attached.

attribute type
issue_name Alphanumeric, dashes, and underscores. (e.g. issue-01)
title String, spaces and other characters allowed.
class tugboatyards.Offer(offer_id=0, offer_name='', user_id=0, page_id=0, amount=0.0, title='', desc='', status='', is_recurring=False, offer_type=None, issues=[])

The Offer object represents something that can be sold within Tugboat Pages.

attribute type
offer_id Integer
offer_name Alphanumeric, dashes, and underscores. (e.g. buy-a-unicorn)
user_id Integer
page_id Integer
amount Decimal
title String, spaces and other characters allowed.
desc String, spaces and other characters allowed.
status One of three strings: ‘active’, ‘deleted’, or ‘archived’.
is_recurring Boolean
offer_type None or the string ‘magazine’.
issues List of tugboatyards.Issue objects.
class tugboatyards.Subscriber(subscriber_id=0, status='', user_name='', email='')

A Subscriber is a buyer that has purchased a recurring offer. Both active and inactive subscribers are represented by this class.

attribute type
subscriber_id Integer
status String, one of ‘active’ or ‘inactive’.
user_name Alphanumeric, dashes, and underscores. (e.g. alincoln_1809)
email String that matches standard email format.
class tugboatyards.Checkout(checkout_id=0, created_on=None, project_id=0, offer_id=0, issue_name='', amount=0.0, state='', state_changed_on=None, buyer={})

A Checkout object contains information about a specific checkout. Only returned via the GetCheckout method.

attribute type
checkout_id Integer
created_on Datetime
project_id Integer
offer_id Integer
issue_name Alphanumeric, dashes, and underscores. (e.g. issue-01)
amount Decimal
state String, one of the following: new, authorized, reserved, captured, settled, cancelled, refunded, charged back, failed, expired.
state_changed_on Datetime
buyer A tugboatyards.Buyer object.
class tugboatyards.Buyer(email='', full_name='', user_id=0, user_name='')

A Buyer can be found attached to Checkout objects.

attribute type
email String that matches standard email format.
full_name String
user_id Integer
user_name Alphanumeric, dashes, and underscores. (e.g. alincoln_1809)