API Reference

config

class connect.config.Config(api_url=None, api_key=None, products=None, file=None)

Initialization config for public api.

Parameters:
  • api_url (str) – Public api url.
  • api_key (str) – Service user ApiKey.
  • products (str|list[str]) – Optional product ids.
  • file (str) – Config file name.
Raises:
  • ValueError – Raised if either file or one of api_url or api_key are missing.
  • TypeError – Raised if products is not a string or list of strings, or if config file does not contain JSON data.
  • IOError – Raised if the specified file could not be opened.
api_key
Returns:ApiKey.
Return type:str
api_url
Returns:Api URL.
Return type:str
classmethod get_instance()
Returns:Global instance.
Return type:Config
products
Returns:Valid product ids.
Return type:list[str]

exceptions

exception connect.exceptions.AcceptUsageFile(acceptance_note)
exception connect.exceptions.CloseUsageFile(message=None)
exception connect.exceptions.DeleteUsageFile(message=None)
exception connect.exceptions.FailRequest(message='')

Causes the request being processed to fail.

Parameters:message (str) – Exception message.
exception connect.exceptions.FileCreationError(message)
exception connect.exceptions.FileRetrievalError(message)
exception connect.exceptions.InquireRequest(message='', params=None)

Causes the request being processed to inquire for some information.

Parameters:
  • message (str) – Exception message.
  • params (List[Param]) – Parameters to inquire.
params = None

(List[Param]) Parameters to inquire.

exception connect.exceptions.Message(message='', code='', obj=None)

Base class for all Connect exceptions.

Parameters:
  • message (str) – Exception message.
  • code (str) – Exception code.
  • obj (object) – Additional information.
code = None

(str) Exception code.

message
Returns:The exception message.
Return type:str

Deprecated since version 16.0: Use str(exception) instead.

obj = None

(str) Additional information.

exception connect.exceptions.RejectUsageFile(message=None)
exception connect.exceptions.ServerError(error)

Indicates that the server returned an error.

Parameters:error (ServerErrorResponse) – Response returned by the server.
exception connect.exceptions.SkipRequest(message='')

Causes the request being processed to be skipped.

Parameters:message (str) – Exception message.
exception connect.exceptions.SubmitUsageFile(rejection_note)
exception connect.exceptions.UsageFileAction(message, code, data=None)

Base exception for Usage API actions.

Parameters:
  • message (str) – Exception message.
  • code (str) – Exception code.
  • data (Optional[Dict[str,Any]]) – Additional information.

models

class connect.models.Activation(**kwargs)

Activation object.

date = None

(datetime.datetime|None) Activation date.

(str|None) Activation link.

message = None

(str) Activation message.

class connect.models.ActivationTemplateResponse(template_id)

An instance of this class might the returned by the overriden process_request method of your connect.resources.FulfillmentAutomation or connect.resources.TierConfigAutomation subclass to approve the request being processed, showing a tile with the specified template id.

Parameters:template_id (str) – Id of the template od the tile to be shown in the Vendor Portal. The template must have been defined in the Vendor Portal.
Return type:None
class connect.models.ActivationTileResponse(markdown='')

An instance of this class might the returned by the overriden process_request method of your connect.resources.FulfillmentAutomation or connect.resources.TierConfigAutomation subclass to approve the request being processed, showing a tile with the specified contents.

Parameters:markdown (str) – Contents of the tile to be shown in the Vendor Portal, in Markdown format.
Return type:None
class connect.models.Agreement(**kwargs)

An Agreement object.

active = None

(bool) State of the version.

agreements = None

(List[Agreement]) Program agreements can have distribution agreements associated with them.

author = None

(User | None) Reference to the user who created the version.

created = None

(datetime.datetime) Date of creation of the agreement.

description = None

(str) Agreement details (Markdown).

(str) Url to the document.

marketplace = None

(Marketplace | None) Reference to marketplace object (for distribution agreement).

owner = None

(Company) Reference to the owner account object.

parent = None

(Agreement | None) Reference to the parent program agreement (for distribution agreement).

stats = None

(AgreementStats | None) Agreement stats.

title = None

(str) Title of the agreement.

type = None

(str) Type of the agreement. One of: distribution, program, service.

updated = None

(datetime.datetime) Date of the update of the agreement. It can be creation of the new version, change of the field, etc. (any change).

version = None

(int) Chronological number of the version.

version_contracts = None

(int) Number of contracts this version has.

version_created = None

(datetime.datetime) Date of the creation of the version.

class connect.models.AgreementStats(**kwargs)

Agreement stats.

contracts = None

(int|None) Number of contracts this agreement has.

versions = None

(int) Number of versions in the agreement.

class connect.models.Asset(**kwargs)

Represents a saleable item that can be provided/distributed in terms of one purchase.

These assets can be requested using connect.resource.FulfillmentAutomation resource.

An asset is characterized by the following:

  • Every asset reflects some purchase (somebody purchases either a service or a good).
  • Purchase action can be reverted (canceled) or terminated when terms of purchase are expired, see full state diagram on FIG.5
  • Asset can be subscription-based (when customer pay for usage in some time terms) or one-time based.
  • Matter of asset is defined as list of purchased items with purchased quantities (asset items).
  • Item in asset may be either reservation-based, when customer decides how many items of SKU to be purchased or Pay-Per-User based when actual use of the SKU defines quantity for asset item.
  • Asset may be modified using change requests: either set of items may be changed or quantities of reservation-based items may be changed.
  • Some assets can be put into suspend state, when service is not actually provided and no charges happened.
  • Assets also may be parametrized by one or more parameters which are differentiate one asset from another.
connection = None

(Connection) Connection object.

external_id = None

(str) Identification for asset object on eCommerce.

external_uid = None

(str|None) Id of asset in eCommerce system

get_item_by_mpn(mpn)

Get an item of the asset.

Parameters:mpn (str) – MPN of the item to get.
Returns:The item with the given MPN, or None if it was not found.
Return type:Item | None
get_param_by_id(id_)

Get a parameter of the asset.

Parameters:id (str) – Id of the the parameter to get.
Returns:The parameter with the given id, or None if it was not found.
Return type:Param | None
items = None

(List[Item]) List of asset product items.

params = None

(List[Param]) List of product parameter objects.

product = None

(Product) Product object reference.

status = None

Assets may have one of the following statuses:

  • new: First purchase requested.
  • processing: Until first purchase request is either completed or rejected.
  • active: After the first purchase request is completed. NOTE: Asset stays active regardless of any other requests except cancel.
  • rejected: Asset becomes rejected once the first purchase request is rejected.
  • terminated: Asset becomes terminated once the ‘cancel’ request type is fulfilled.
  • suspended: Asset becomes suspended once ‘suspend’ request type is fulfilled.
tiers = None

(TierAccounts) Supply chain accounts.

class connect.models.BaseModel(**kwargs)

Base class of all models.

All the arguments provided on creation of the model are injected as attributes on the object.

classmethod deserialize(json_str)

Deserialize a string containing JSON data into a model.

Parameters:json_str (str) – String containing the JSON data to be deserialized.
Returns:An instance of the same class as the receiver of the call, or a list of instances.
Return type:Any|list[Any]
Raises:TypeError – Raised if the data cannot be deserialized.
classmethod deserialize_json(json_data)

Deserialize JSON data into a model.

Parameters:json_data (dict|list) – JSON list or dictionary to be deserialized.
Returns:An instance of the same class as the receiver of the call, or a list of instances.
Return type:Any|list[Any]
Raises:TypeError – Raised if the data cannot be deserialized.
id = None

(str) Globally unique id.

json
Returns:The JSON representation of the model.
Return type:dict|list
class connect.models.Company(**kwargs)

Represents a company within the platform.

name = None

(str) Company name.

class connect.models.Configuration(**kwargs)

Configuration Phase Parameter Context-Bound Data Object.

To be used in parameter contexts:

  • Asset.
  • Fulfillment Request.
  • TierConfig.
  • TierConfig Requests.
params = None

(List[Param])

class connect.models.Connection(**kwargs)

Represents a communication channel which provides the ability to order products within particular hub.

Standalone connection is required for each product and for each provider account.

hub = None

(Hub) Hub Reference.

product = None

(Product) Product Reference.

provider = None

(Company) Provider Account Reference.

type = None

(str) Type of connection.

vendor = None

(Company) Vendor Account Reference.

class connect.models.Constraints(**kwargs)

Parameter constraints.

choices = None

(List[ValueChoice]) Parameter value choices.

hidden = None

(bool) Is the parameter hidden?

required = None

(bool) Is the parameter required?

unique = None

(bool) Is the constraint unique?

class connect.models.Contact(**kwargs)

Person of contact.

email = None

(str) Email address.

first_name = None

(str|None) First name.

last_name = None

(str|None) Last name.

phone_number = None

(PhoneNumber) Phone number.

class connect.models.ContactInfo(**kwargs)

Represents the information of a contact.

address_line1 = None

(str) Street address, first line.

address_line2 = None

(str|None) Street address, second line.

city = None

(str) City name.

contact = None

(Contact) Person of contact.

country = None

(str) Country code.

postal_code = None

(str) Postal ZIP code.

state = None

(str) State name.

class connect.models.Contract(**kwargs)

Contract object.

activation = None

(Activation) Activation information.

agreement = None

(Agreement) Reference object to the agreement.

created = None

(datetime.datetime) Contract creation date.

creator = None

(User) Reference object to the creator.

enrolled = None

(datetime.datetime|None) Date when contract was enrolled.

marketplace = None

(Marketplace | None) Reference object to the agreement marketplace.

name = None

(str) Contract name.

owner = None

(Company | None) Reference object to the owner company.

signee = None

(User | None) Reference object to the user of the owner company, who signed the contract.

status = None

(str) Contract Status. One of: enrolling, pending, active, terminated, rejected

type = None

(str) Type of the contract (same as agreement type). One of: distribution, program, service.

updated = None

(datetime.datetime) Date of contract status update.

version = None

(int) Version of the contract (same as associated agreement version).

version_created = None

(datetime.datetime) Contract version creation date.

class connect.models.Conversation(**kwargs)

Conversation.

add_message(message, config=None)

Adds a message to the conversation.

Parameters:
  • message (str) – Message to add.
  • config (Config) – Configuration, or None to use the environment config (default).
Returns:

The added message.

Return type:

ConversationMessage

Raises:

TypeError – Raised if the message cannot be deserialized.

created = None

(datetime.datetime) Date of the Conversation creation.

creator = None

(User) Creator of the conversation.

instance_id = None

(str) The id of object based on which discussion is made, e.g. listing request. It can be any object.

messages = None

(List[ConversationMessage]) List of ConversationMessage objects.

topic = None

(str) Conversation topic.

class connect.models.ConversationMessage(**kwargs)

Message in a Conversation.

conversation = None

(str) Primary ID of Conversation object.

created = None

(datetime.datetime) Date of the Message creation.

creator = None

(User) User that created the message.

text = None

(str) Actual message.

class connect.models.CustomerUiSettings(**kwargs)

Customer Ui Settings for a product.

description = None

(str) Description.

documents = None

(List[Document]) Documents.

(List[DownloadLink]) Download links.

getting_started = None

(str) Getting started.

class connect.models.Document(**kwargs)

Document for a product.

title = None

(str) Document title.

url = None

(str) Document URL.

Download link for a product.

title = None

(str) Link title.

url = None

(str) Link URL.

visible_for = None

(str) Link visibility. One of: admin, user.

class connect.models.EventInfo(**kwargs)

Represents the date and user that caused an event.

at = None

(datetime.datetime|None) Date when the event occurred.

by = None

(User) User that caused the event.

class connect.models.Events(**kwargs)

Represents a set of events that can take place on an object.

accepted = None

(EventInfo) Accept event.

approved = None

(EventInfo) Approve event.

closed = None

(EventInfo) Close event.

created = None

(EventInfo) Creation event.

inquired = None

(EventInfo) Inquire event.

pended = None

(EventInfo) Pending event.

rejected = None

(EventInfo) Reject event.

submitted = None

(EventInfo) Submit event.

updated = None

(EventInfo) Update event.

uploaded = None

(EventInfo) Uploaded event.

validated = None

(EventInfo) Validation event.

class connect.models.ExtIdHub(**kwargs)

Associates a Hub with an external id.

external_id = None

(str) External id.

hub = None

(Hub) Hub.

class connect.models.Fulfillment(**kwargs)

Represents a request for the connect.resource.FulfillmentAutomation resource.

activation_key = None

(str) Activation key content for activating the subscription on vendor portal. This markdown formatted message is sent to customer.

asset = None

(Asset) Asset object.

changed_items
Returns:Changed items.
Return type:List[Item]
contract = None

(Contract) Contract object.

created = None

(datetime.datetime) Date of request creation.

get_conversation(config=None)
Parameters:config (Config) – Configuration, or None to use the environment config (default).
Returns:The conversation for this request, or None if there is none.
Return type:Conversation|None
marketplace = None

(Marketplace) Marketplace object.

needs_migration(migration_key='migration_info')

Indicates whether the request contains data to be migrated from a legacy product. Migration is performed by an external service. All you have to do for a request that needs migration is to skip processing by raising a connect.exceptions.SkipRequest exception.

Parameters:migration_key (str) – The name of the parameter that contains the migration data (optional; default value is migration_info).
Returns:Whether the request needs migrating.
Return type:bool
new_items
Returns:New items.
Return type:List[Item]
note = None

(str) Details of note.

params_form_url = None

(str) URL for customer/reseller/provider for modifying param value based on vendor’s feedback.

reason = None

(str) Fail reason in case of status of request is failed.

removed_items
Returns:Removed items.
Return type:List[Item]
status = None

(str) Status of request. One of:

  • pending
  • inquiring
  • failed
  • approved

Valid status changes:

  • pending -> inquiring
  • pending -> failed
  • pending -> approved
  • inquiring -> failed
  • inquiring -> approved
  • inquiring -> pending
type = None

(str) Asset status. See Asset class for details.

updated = None

(datetime.datetime) Date of last request modification.

class connect.models.Hub(**kwargs)

A Hub.

company = None

(Company) Reference to the company the hub belongs to.

description = None

(str|None) Hub description (Markdown text).

events = None

(Events) Events occurred on Hub.

instance = None

(HubInstance) Hub instance.

name = None

(str) Hub name.

stats = None

(HubStats) Hub stats.

class connect.models.HubInstance(**kwargs)

An instance of a hub.

type = None

(str) E-Commerce system type.

class connect.models.HubStats(**kwargs)

Hub stats.

connections = None

(int) Number of connections active for this Hub.

marketplaces = None

(int) Number of marketplaces for this Hub.

class connect.models.Item(**kwargs)

A product item.

display_name = None

(str) Display name.

global_id = None

(str) Global id.

item_type = None

(str) Item type.

mpn = None

(str) Item manufacture part number.

name = None

(str) Name.

old_quantity = None

(int|float|None) Previous value of quantity.

params = None

(List[Param | None] List of Item and Item x Marketplace Configuration Phase Parameter Context-Bound Object

period = None

(str) Period.

quantity = None

(int|float) Number of items of the type in the asset (-1 if unlimited)

renewal = None

(Renewal | None) Parameters of renewal request (empty for all other types).

type = None

(str) Type.

class connect.models.Marketplace(**kwargs)

An object containing Distribution agreements with exact Hubs, enriched with additional information on details about the relation.

A Marketplace is a way to list Products to specified regions (based on Distribution Agreements) and use specific Hubs to provision incoming Fulfillment requests.

active_contracts = None

(int) How many active contracts were signed on the Marketplace.

description = None

(str) Markdown text describing the marketplace.

hubs = None

(List[ExtIdHub]) List of account-hub relations associated with the Marketplace object.

icon = None

(str) Image identifying Marketplace object uploaded by user.

name = None

(str) Marketplace title, unique for an account.

owner = None

(Company) Provider account - the object owner.

zone = None

(str) Zone where the marketplace is located, there can be following zones: AF, NA, OC, AS, EU, SA (It is continents).

class connect.models.Param(**kwargs)

Parameters are used in product and asset definitions.

constraints = None

(Constraints | None) Parameter constraints.

description = None

(str) Description of parameter.

events = None

(Events | None) Events.

marketplace = None

(Marketplace | None) Marketplace.

name = None

(str) Name of parameter.

phase = None

(str|None) Param phase.

scope = None

(str|None) Scope of parameter.

title = None

(str|None) Title for parameter.

type = None

(str) Type of parameter.

value = None

(str|None) Value of parameter.

value_choice = None

(List[str]|None) Available choices for parameter.

value_choices = None

(List[str]|None) Available dropdown choices for parameter.

value_error = None

(str|None) Error indicated for parameter.

class connect.models.PhoneNumber(**kwargs)

Phone number.

area_code = None

(str|None) Area code.

country_code = None

(str|None) Country code.

extension = None

(str|None) Phone extension.

phone_number = None

(str|None) Phone number.

class connect.models.Product(**kwargs)

Represents basic marketing information about salable items, parameters, configurations, latest published version and connections.

It contains basic product information like name, description and logo, along with the latest published version details. So in a single point we can say a single product object always represent the latest published version of that product.

category = None

(ProductCategory | None) Reference to ProductCategory Object.

configurations = None

(ProductConfiguration) Product configuration.

customer_ui_settings = None

(CustomerUiSettings) Customer Ui Settings.

detailed_description = None

(str) Detailed description of product.

icon = None

(str) Product icon URI.

latest = None

(bool|None) true if version is latest or for master versions without versions, false otherwise.

name = None

(str) Product name.

owner = None

(Company | None)

published_at = None

(datetime.datetime) Date of publishing.

short_description = None

(str) Short description of product.

stats = None

(:py:class:``.ProductStats) Statistics of product use, depends on account of callee.

version = None

(int) Version of product.

class connect.models.ProductCategory(**kwargs)

Represents a product category.

children = None

(List[ProductCategory] | None) List of children categories.

family = None

(ProductFamily | None) Product family.

name = None

(str) Category name.

parent = None

(ProductCategory | None) Reference to parent category.

class connect.models.ProductConfiguration(**kwargs)

Product configurations.

requires_reseller_information = None

(bool) Does the product require reseller information?

suspend_resume_supported = None

(bool) Is suspend and resume supported for the product?

class connect.models.ProductFamily(**kwargs)

Represents a family of products

name = None

(str) Family name.

class connect.models.ProductStats(**kwargs)

Statistics of product use.

agreements = None

(ProductStatsInfo) Agreements related to the product.

contracts = None

(ProductStatsInfo) Contracts related to the product

listing = None

(int) Number of listings (direct use of product by provider).

class connect.models.ProductStatsInfo(**kwargs)
distribution = None

(int) Number of distributions related to the product.

sourcing = None

(int) Number of sourcings related to the product.

class connect.models.Renewal(**kwargs)

Item renewal data.

from_ = None

(datetime.datetime) Date of renewal beginning.

period_delta = None

(int) Size of renewal period.

period_uom = None

(str) Unit of measure for renewal period. One of: year, month, day, hour.

to = None

(datetime.datetime) Date of renewal end.

class connect.models.ServerErrorResponse(**kwargs)

Server response when an error occurs.

error_code = None

(str) Error code.

errors = None

(List[str]) List of errors.

params = None

(dict) Error params.

class connect.models.Template(**kwargs)

Tier Template

name = None

(str) Template name.

representation = None

(str) Template representation.

class connect.models.TierAccount(**kwargs)

Tier account.

contact_info = None

(ContactInfo) Tier Contact Object.

external_id = None

(str|None) Only in case of filtering by this field.

external_uid = None

(str|None) Only in case of filtering by this field.

name = None

(str) Tier name.

class connect.models.TierAccounts(**kwargs)

TierAccounts object.

customer = None

(TierAccount) Customer Level TierAccount Object.

tier1 = None

(TierAccount) Level 1 TierAccount Object.

tier2 = None

(TierAccount) Level 2 TierAccount Object.

class connect.models.TierConfig(**kwargs)

Full representation of Tier object.

account = None

(TierAccount) Full tier account representation (same as in Asset).

configuration = None

(Configuration) List of Product and Marketplace Configuration Phase Parameter Context-Bound Object.

connection = None

(Connection) Reference to Connection Object.

contract = None

(Contract) Contract Object reference.

events = None

(Events | None) Tier Config events.

classmethod get(account_id, product_id, config=None)

Gets the specified tier config data. For example, to get Tier 1 configuration data for one request we can do:

TierConfig.get(request.asset.tiers.tier1.id, request.asset.product.id)
Parameters:
  • account_id (str) – Account Id of the requested Tier Config (id with TA prefix).
  • product_id (str) – Id of the product.
  • config (Config) – Config to use, or None to use environment config (default).
Returns:

The requested Tier Config, or None if it was not found.

Return type:

Optional[TierConfig]

get_param_by_id(id_)

Get a Tier Config parameter.

Parameters:id (str) – Parameter id.
Returns:The requested parameter, or None if it was not found.
Return type:Param
marketplace = None

(Marketplace) Marketplace Object reference.

name = None

(str) Tier configuration of account.name.

open_request = None

(BaseModel | None) Reference to TCR.

params = None

(List[Param]) List of TC parameter data objects as in Asset Object extended with unfilled parameters from product.

product = None

(Product) Reference object to product (application).

template = None

(Template) Template Object.

tier_level = None

(int) Tier level for product from customer perspective.

class connect.models.TierConfigRequest(**kwargs)
account = None

(TierAccount) Reference object to TierAccount.

activation = None

(Activation | None) Activation object. This is created only if TCR has ordering parameters and seen in inquiring state of the TCR.

assignee = None

(User | None) TCR environment. One of: test, prod, preview.

configuration = None

(TierConfig) Full representation of TierConfig Object.

environment = None

(str) TCR environment (test, prod or preview)

events = None

(Events | None) Tier Config request Events.

get_param_by_id(id_)

Get a Tier Config Request parameter.

Parameters:id (str) – Parameter id.
Returns:The requested parameter, or None if it was not found.
Return type:Param
notes = None

(str) TCR pending notes. Notes can be modified only in Pending state.

params = None

(List[Param]) List of parameter data objects as in Asset Object. Params can be modified only in Pending state.

parent_configuration = None

(TierConfig | None) Full representation of parent TierConfig.

product = None

(Product) Reference object to product (application).

reason = None

(str|None) Failing reason. This is filled only if TCR is failed.

status = None

(str) TCR current status. One of: tiers_setup, pending, inquiring, approved, failed.

template = None

(Template | None) Template Object. This is filled only if TCR is approved.

tier_level = None

(int) Tier level for product from customer perspective (1 or 2).

type = None

(str) TCR type. One of: setup, update.

class connect.models.UsageFile(**kwargs)

Usage File Object.

acceptance_note = None

(str) Note provided by the provider in case of acceptance of the usage file.

contract = None

(Contract) Reference on Contract Object.

created_at = None

(str) Date of the creation of the UsageFile.

created_by = None

(str) User ID who have created this UsageFile.

description = None

(str) Vendor can provide a description value in this field to describe the file content.

error_details = None

(str) In case of invalid file, this field will contain errors related to the file.

events = None

(Events) Events occured on file.

marketplace = None

(Marketplace Reference on Marketplace Object.

name = None

(str) Name of the Usage file object.

note = None

(str) Vendor can put a note which can be refer later for some extra information.

processed_file_uri = None

(str) Google Storage shared location of the generated file after processing uploaded file. Only available in GET API and not included in list API (sharing timeout 30 sec).

product = None

(Product) Reference on Product Object.

provider = None

(Company Reference object to the provider company.

records = None

(UsageRecords) UsageRecords Object.

rejection_note = None

(str) Note provider by the provider in case of rejection of the usage file.

status = None

(str) One of: draft, uploading, uploaded, processing, invalid, ready, rejected, pending, accepted, closed.

upload_file_uri = None

(str) Google Storage shared location of the upload file. Only available in GET API and not included in list API (sharing timeout 600 sec).

vendor = None

(Company Reference object to the vendor company.

class connect.models.UsageListing(**kwargs)

Usage Listing Object.

contract = None

(Contract) Contract Object.

created = None

(str) Creation time.

product = None

(Product) Product Object.

provider = None

(Company) Provider Object.

status = None

(str) Status.

vendor = None

(Company) Vendor Object.

class connect.models.UsageRecord(**kwargs)

Usage Record Object.

asset_search_criteria = None

(str) Asset search criteria.

asset_search_value = None

(str) Asset search value.

end_time_utc = None

(str) End Time in UTC.

item_search_criteria = None

(str) Item search criteria.

item_search_value = None

(str) Item search value.

quantity = None

(int) Quantity.

start_time_utc = None

(str) Start Time in UTC.

usage_record_id = None

(str) Usage record id.

class connect.models.UsageRecords(**kwargs)

Usage Records Object.

invalid = None

(int) Invalid.

valid = None

(int) Valid.

class connect.models.User(**kwargs)

Represents a user within the platform.

name = None

(str) User name.

class connect.models.ValueChoice(**kwargs)

A value choice for a parameter.

label = None

(str) Label.

value = None

(str) Value.

resources

class connect.resources.Directory(config=None)

Allows listing and obtaining several types of objects.

Parameters:config (Config) – Config object or None to use environment config (default).
get_asset(asset_id)

Returns the asset with the given id.

Parameters:asset_id (str) – The id of the asset.
Returns:The asset with the given id, or None if such asset does not exist.
Return type:Asset|None
get_product(product_id)

Returns the product with the given id.

Parameters:product_id (str) – The id of the product.
Returns:The product with the given id, or None if such product does not exist.
Return type:Product|None
get_tier_config(tier_config_id)

Returns the tier config with the given id.

Parameters:tier_config_id (str) – The id of the tier config.
Returns:The Tier Config with the given id, or None if such Tier Config does not exist.
Return type:TierConfig|None
list_assets(filters=None)

List the assets.

Parameters:Any] filters ((dict[str,) – Filters to pass to the request.
Returns:A list with the assets that match the given filters.
Return type:list[Asset]
list_products()

List the products. Filtering is not possible at the moment.

Returns:A list with all products.
Return type:list[Product]
list_tier_configs(filters=None)

List the tier configs.

Parameters:Any] filters ((dict[str,) – Filters to pass to the request.
Returns:A list with the tier configs that match the given filters.
Return type:list[TierConfig]
class connect.resources.FulfillmentAutomation(config=None)

This is the automation engine for the Fulfillment API. If you want to process fulfillment requests, subclass this and implement the process_request method, which receives a connect.models.Fulfillment request as argument and must return an connect.models.ActivationTemplateResponse or connect.models.ActivationTileResponse object in case the request has to be approved.

In other case, you must raise one of these exceptions:

Create an instance of your subclass and call its process method to begin processing.

For an example on how to use this class, see Processing Fulfillment Requests.

create_request(request)

Creates a new request. Using this method requires a provider token used as api_key in the Config.

Parameters:request (Fulfillment) –
Returns:The created request.
Return type:Fulfillment
filters(status='pending', **kwargs)

Returns the default set of filters for Fulfillment request, plus any others that you might specify. The allowed filters are:

  • status
  • created
  • id (List support)
  • type (purchase|renew|change|cancel)
  • asset.id (asset_id) - (List support)
  • asset.product.id (product_id)
  • asset.product.name - (List support)
  • asset.hub.id
  • asset.connection.hub.name - (List support)
  • asset.connection.provider.id
  • asset.connection.provider.name - (List support)
  • asset.connection.vendor.name - (List support)
  • asset.tiers.customer.id (Customer ID)
  • asset.tiers.tier1.id
  • asset.tiers.tier2.id
  • asset.connection.type (test|production|preview)
Parameters:
  • status (str) – Status of the requests. Default: 'pending'.
  • kwargs (dict[str,Any]) – Additional filters to add to the default ones.
Returns:

The set of filters for this resource.

Return type:

dict[str,Any]

get_tier_config(tier_id, product_id)

Gets the specified tier config data. For example, to get Tier 1 configuration data for one request, within the FulfillmentAutomation instance, we can do:

self.get_tier_config(request.asset.tiers.tier1.id, request.asset.product.id)
Parameters:
  • tier_id (str) – Account Id of the requested Tier Config (id with TA prefix).
  • product_id (str) – Id of the product.
Returns:

The requested Tier Config, or None if it was not found.

Return type:

Optional[TierConfig]

Deprecated since version 16.0: Use TierConfig.get instead.

model_class

alias of connect.models.fulfillment.Fulfillment

update_parameters(pk, params)

Sends a list of Param objects to Connect for updating.

Parameters:
  • pk (str) – Id of the request.
  • params (list[Param]) – List of parameters to update.
Returns:

The server response.

Return type:

str

class connect.resources.TemplateResource(config=None)

Template Resource.

get(pk)

Get an activation template.

Parameters:pk (str) – Primary key of the template to obtain.
Returns:ActivationTemplateResponse object with template contents.
Return type:ActivationTemplateResponse
render(pk, request_id)

Get an activation tile.

Parameters:
  • pk (str) – Primary key of the template to obtain.
  • request_id (str) – Id of the associated request.
Returns:

ActivationTileResponse object with tile contents.

Return type:

ActivationTileResponse

class connect.resources.TierConfigAutomation(config=None)

This is the automation engine for the Tier Config Request API. If you want to process Tier Config requests, subclass this and implement the process_request method, which receives a connect.models.TierConfigRequest request as argument and must return an connect.models.ActivationTemplateResponse or connect.models.ActivationTileResponse object in case the request has to be approved.

In other case, you must raise one of these exceptions:

Create an instance of your subclass and call its process method to begin processing.

For an example on how to use this class, see Processing Tier Config Requests.

model_class

alias of connect.models.tier_config.TierConfigRequest

update_parameters(pk, params)

Sends a list of Param objects to Connect for updating.

Parameters:
  • pk (str) – Id of the request.
  • params (list[Param]) – List of parameters to update.
Returns:

The server response.

Return type:

str

class connect.resources.UsageAutomation(config=None)

Automates reporting of Usage Files.

For an example on how to use this class, see Reporting Usage Files.

filters(status='listed', **kwargs)
Parameters:
  • status (str) – Status of the requests. Default: 'listed'.
  • kwargs (dict[str,Any]) – Additional filters to add to the default ones.
Returns:

The set of filters for this resource.

Return type:

dict[str,Any]

get_usage_template(product)

Returns the template file contents for a specified product.

Parameters:product (Product) – Specific product.
Returns:The template file contents.
Return type:bytes
Raises:FileRetrievalError – Raised if the file contents could not be retrieved.
model_class

alias of connect.models.usage.UsageFile

submit_usage(usage_file, usage_records)

Submit a usage file.

Parameters:
Returns:

Usage file.

Return type:

UsageFile

Raises:

FileCreationError – Raised if creation or uploading of the file fails.

class connect.resources.UsageFileAutomation(config=None)

Automates workflow of Usage Files.

For an example on how to use this class, see Workflow of Usage Files.

filters(status='ready', **kwargs)
Parameters:
  • status (str) – Status of the requests. Default: 'ready'.
  • kwargs (dict[str,Any]) – Additional filters to add to the default ones.
Returns:

The set of filters for this resource.

Return type:

dict[str,Any]

model_class

alias of connect.models.usage.UsageFile