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 ofapi_url
orapi_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
-
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.
-
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
(rejection_note)¶
-
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
¶
-
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.
-
link
= None¶ (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 yourconnect.resources.FulfillmentAutomation
orconnect.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 yourconnect.resources.FulfillmentAutomation
orconnect.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.
(
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).
-
link
= None¶ (str) Url to the document.
-
marketplace
= None¶ (
Marketplace
| None) Reference to marketplace object (for distribution agreement).
-
name
= None¶ (str) Name of Agreement.
-
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.
Anniversary
(**kwargs)¶ An Anniversary object.
-
day
= None¶ (str) Day of the anniversay.
-
month
= None¶ (str) Month of the anniversary.
-
-
class
connect.models.
AssetRequest
(**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.
-
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
-
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.
-
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
-
updated
= None¶ (datetime.datetime) Date of last request modification.
-
-
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.
-
configuration
= None¶ (
Configuration
) List of Product and Marketplace Configuration Phase Parameter Context-Bound Object.
-
connection
= None¶ (
Connection
) Connection object.
-
external_id
= None¶ (str) Identification for asset object on eCommerce.
-
external_name
= None¶ (str|None) Name of asset.
-
external_uid
= None¶ (str|None) Id of asset in eCommerce system.
-
get_item_by_global_id
(global_id)¶ Get an item of the asset.
Parameters: global_id (str) – Global id of the item to get. Returns: The item with the given global id, or None
if it was not found.Return type: Item
| None
-
get_item_by_id
(item_id)¶ Get an item of the asset.
Parameters: item_id (str) – Id of the item to get. Returns: The item with the given id, or None
if it was not found.Return type: Item
| None
-
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
(param_id)¶ Get a parameter of the asset.
Parameters: param_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
-
get_requests
(config=None)¶ Get the requests for this asset.
Parameters: config (Config) – Config object or None
to use environment config (default).Returns: The requests for this asset. Return type: List[Fulfillment]
-
marketplace
= None¶ (
Marketplace
) Marketplace 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.
Attributes
(**kwargs)¶ Attributes object.
-
provider
= None¶ (obj) Attributes Provider.
-
vendor
= None¶ (obj) Attributes Vendor.
-
-
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
-
classmethod
-
class
connect.models.
Billing
(**kwargs)¶ Billing object.
-
anniversary
= None¶ (
Anniversary
) Anniversary.
-
next_date
= None¶ (str) Next date of the billing.
-
-
class
connect.models.
BillingRequest
(**kwargs)¶ BillingRequest object.
-
asset
= None¶ (object) Billing Request Asset.
-
attrubutes
= None¶ (object) Billing Request Attributes.
-
events
= None¶ (object) Billing Request Events.
-
item
= None¶ (object) Billing Request Item.
-
period
= None¶ (object) Billing Request Period.
-
type
= None¶ (vendor|provider) Billing Request type.
-
-
class
connect.models.
Company
(**kwargs)¶ Represents a company within the platform.
-
count
= None¶ (integer) Count.
-
last_request
= None¶ (
LastRequest
) Last Request of companySchema.
-
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.
-
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.
-
created_at
= None¶ (datetime.datetime) Creation date.
-
status
= None¶ (str) Status.
-
type
= None¶ (str) Type of connection.
-
-
class
connect.models.
Constraints
(**kwargs)¶ Parameter constraints.
-
choices
= None¶ (List[
ValueChoice
]) Parameter value choices.
(bool) Is the parameter hidden?
-
max_length
= None¶ (integer) Only for password type
-
min_length
= None¶ (integer) Only for password type
-
reconciliation
= None¶ (bool) True if vendor has marked parameters as for reconciliation purposes
-
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.
-
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.
-
created
= None¶ (datetime.datetime) Contract creation date.
-
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.
-
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.
Country
(**kwargs)¶ Country data.
-
icon
= None¶ (str) Icon path.
-
name
= None¶ (str) Country name.
-
zone
= None¶ (str) Geographical zone.
-
-
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: Raises: TypeError – Raised if the message cannot be deserialized.
-
created
= None¶ (datetime.datetime) Date of the Conversation creation.
-
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 ofConversationMessage
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.
-
text
= None¶ (str) Actual message.
-
-
class
connect.models.
CustomerUiSettings
(**kwargs)¶ Customer Ui Settings for a product.
-
description
= None¶ (str) Description.
-
download_links
= None¶ (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.
-
-
class
connect.models.
DownloadLink
(**kwargs)¶ 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.
Event
(**kwargs)¶ Represents the date and user that caused an event.
-
at
= None¶ (datetime.datetime|None) Date when the event occurred.
-
-
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.
-
-
class
connect.models.
Fulfillment
(*args, **kwargs)¶ Represents a request for the
connect.resource.FulfillmentAutomation
resource.
-
class
connect.models.
Hub
(**kwargs)¶ A Hub.
-
description
= None¶ (str|None) Hub description (Markdown text).
-
instance
= None¶ (
HubInstance
) Hub instance.
-
name
= None¶ (str) Hub name.
-
-
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.
-
get_param_by_id
(param_id)¶ Get a parameter of the item.
Parameters: param_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
-
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)
-
type
= None¶ (str) Type.
-
-
class
connect.models.
LastRequest
(**kwargs)¶ Last Request object.
-
type
= None¶ (str) Type of last request.
-
-
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.
-
icon
= None¶ (str) Image identifying Marketplace object uploaded by user.
-
name
= None¶ (str) Marketplace title, unique for an account.
-
sourcing
= None¶ (bool) Is marketplace available for sourcing.
-
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.
-
marketplace
= None¶ (
Marketplace
| None) Marketplace.
-
name
= None¶ (str) Name of parameter.
-
phase
= None¶ (str|None) Param phase.
-
reconciliation
= None¶ (bool|None) Is Parameter used as reconciliation one from vendor invoices
-
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.
Period
(**kwargs)¶ Period object.
-
delta
= None¶ (string) Period Delta.
-
period_from
= None¶ (datetime.date) Period From.
-
period_to
= None¶ (datetime.date) Period To.
-
uom
= None¶ (string) Period uom.
-
-
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.
-
get_product_configurations
(filters=None, config=None)¶ Parameters: - filters (dict|Query) – Filters for the requests. Supported filters are:
-
parameter.id
-parameter.title
-parameter.scope
-marketplace.id
-marketplace.name
-item.id
-item.name
-value
- config (Config) – Configuration to use, or None for environment config.
Returns: A list with the product configuration parameter data.
Return type: - filters (dict|Query) – Filters for the requests. Supported filters are:
-
-
get_templates
(config=None)¶ Parameters: config (Config) – Configuration to use, or None for environment config. Returns: List of all templates associated with the product. Return type: List[Template]
-
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.
-
published_at
= None¶ (datetime.datetime) Date of publishing.
-
short_description
= None¶ (str) Short description of product.
-
status
= None¶ (str) Product status.
-
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.
ProductConfigurationParameter
(**kwargs)¶ Representation of Configuration Phase Parameter (CPP) Data object
-
constraints
= None¶ (
Constraints
) Constraints.
-
marketplace
= None¶ (
Marketplace
| None) Reference to Marketplace.
-
value
= None¶ (str|None) Configuration parameter value.
-
-
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.
RecurringAsset
(**kwargs)¶ RecurringAsset object.
-
billing
= None¶ (object) Billing Request billing.
-
connection
= None¶ (object) Billing Request connection.
-
contract
= None¶ (object) Billing Request Contract.
-
events
= None¶ (object) Billing Request Events.
-
external_id
= None¶ (str) External Id.
-
external_uuid
= None¶ (str) External uuId.
-
items
= None¶ (object) Billing Request Item.
-
marketplace
= None¶ (object) Billing Request marketplace.
-
params
= None¶ (object) Billing Request Params.
-
product
= None¶ (object) product.
-
status
= None¶ (vendor|provider) Billing Request status.
-
tiers
= None¶ (object) Billing Request tiers.
-
-
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.
Stat
(**kwargs)¶ Stats object.
-
count
= None¶ (Int) Count.
-
last_request
= None¶ (
LastRequest
) Last Request.
-
-
class
connect.models.
Stats
(**kwargs)¶ Stats object.
-
class
connect.models.
Template
(**kwargs)¶ Tier Template
-
body
= None¶ (str) Template body.
-
name
= None¶ (str) Template name.
-
representation
= None¶ (str) Template representation.
-
-
class
connect.models.
TierAccount
(**kwargs)¶ Tier account.
-
class
connect.models.
TierAccountRequest
(**kwargs)¶ Tier account request.
-
class
connect.models.
TierAccounts
(**kwargs)¶ TierAccounts object.
-
customer
= None¶ (
TierAccount
) Customer Level TierAccount Object.
-
tier1
= None¶ (
TierAccount
) Level 1 TierAccount Object.
-
tier2
= None¶ (
TierAccount
| None) Level 2 TierAccount Object.
-
-
class
connect.models.
TierConfig
(**kwargs)¶ Full representation of Tier object.
-
account
= None¶ (
TierAccount
) Full tier account representation (same as inAsset
).
-
configuration
= None¶ (
Configuration
) List of Product and Marketplace Configuration Phase Parameter Context-Bound Object.
-
connection
= None¶ (
Connection
) Reference to Connection Object.
-
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.
-
params
= None¶ (List[
Param
]) List of TC parameter data objects as in Asset Object extended with unfilled parameters from product.
-
status
= None¶ (str) TierConfig status.
-
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.
-
configuration
= None¶ (
TierConfig
) Full representation of TierConfig Object.
-
environment
= None¶ (str) TCR environment (test, prod or preview)
-
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
-
marketplace
= None¶ (
Marketplace
| None) TierConfig marketplace.
-
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.
-
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.
-
tier_level
= None¶ (int) Tier level for product from customer perspective (1 or 2).
-
tiers
= None¶ (
TierAccounts
| None) TierConfig tier accounts.
-
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.
-
created_at
= None¶ (str) Date of the creation of the UsageFile.
-
created_by
= None¶ (str) User ID who have created this UsageFile.
-
currency
= None¶ (str) Currency of the amount included in usage file.
-
description
= None¶ (str) Vendor can provide a description value in this field to describe the file content.
-
environment
= None¶ (str) Environment.
-
error_details
= None¶ (str) In case of invalid file, this field will contain errors related to the file.
-
external_id
= None¶ (str) External ID of the 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.
-
period_from
= None¶ (str) Date & time from which usage records are considered in this usage file.
-
period_to
= None¶ (str) Date & time from which usage records are considered in this usage file.
-
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).
-
records
= None¶ (
UsageRecords
) UsageRecords Object.
-
rejection_note
= None¶ (str) Note provider by the provider in case of rejection of the usage file.
-
schema
= None¶ (str)Usage Scheme used for the usage file.
-
stats
= None¶ (
UsageStats
) UsageStats Object.
-
status
= None¶ (str) One of: draft, uploading, uploaded, processing, invalid, ready, rejected, pending, accepted, closed.
-
usage_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).
-
-
class
connect.models.
UsageListing
(**kwargs)¶ Usage Listing Object.
-
created
= None¶ (str) Creation time.
-
status
= None¶ (str) Status.
-
-
class
connect.models.
UsageRecord
(**kwargs)¶ Usage Record Object.
-
amount
= None¶ (float) Amount.
-
asset_recon_id
= None¶ (str) Asset recon Id.
-
asset_search_criteria
= None¶ (str) Asset search criteria.
-
asset_search_value
= None¶ (str) Asset search value.
-
category_id
= None¶ (str) Category Id.
-
end_time_utc
= None¶ (str) End Time in UTC.
-
item_name
= None¶ (str) Item name.
-
item_npm
= None¶ (str) Item npm.
-
item_precision
= None¶ (str) Item precision.
-
item_search_criteria
= None¶ (str) Item search criteria.
-
item_search_value
= None¶ (str) Item search value.
-
item_unit
= None¶ (str) Item unit.
-
quantity
= None¶ (int) Quantity.
-
start_time_utc
= None¶ (str) Start Time in UTC.
-
tier
= None¶ (str) Tier.
-
usage_record_id
= None¶ (str) Usage record id.
-
usage_record_note
= None¶ (str) Usage record note.
-
-
class
connect.models.
UsageRecords
(**kwargs)¶ Usage Records Object.
-
invalid
= None¶ (int) Invalid.
-
valid
= None¶ (int) Valid.
-
-
class
connect.models.
UsageStats
(**kwargs)¶ Usage Stats object.
-
accepted
= None¶ (Int) Accepted.
-
closed
= None¶ (Int) Closed.
-
pending
= None¶ (Int) Pending.
-
uploaded
= None¶ (Int) Uploaded.
-
validated
= None¶ (Int) Validated.
-
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_marketplace
(marketplace_id)¶ Obtains Marketplace object given its ID.
Parameters: marketplace_id (str) – The id of the marketplace. Returns: The marketplace with the given id, or None
if such marketplace does not exist.Return type: Marketplace|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: filters (dict|Query) – Filters to pass to the request. Returns: A list with the assets that match the given filters. Return type: list[Asset]
-
list_marketplaces
(filters=None)¶ List the marketplaces.
Parameters: filters (dict|Query) – Filters to pass to the request. Returns: List of marketplaces matching given filters. Return type: list[Marketplace]
-
list_products
(filters=None)¶ List the products.
Parameters: filters (dict|Query) – Filters to pass to the request. 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 aconnect.models.Fulfillment
request as argument and must return anconnect.models.ActivationTemplateResponse
orconnect.models.ActivationTileResponse
object in case the request has to be approved.In other case, you must raise one of these exceptions:
connect.exceptions.InquireRequest
: Inquire for more information.connect.exceptions.FailRequest
: Causes the request to fail.connect.exceptions.SkipRequest
: Skips processing the request.
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
-
class
connect.resources.
MarketplaceResource
(config=None)¶ Resource to work with
connect.models.Marketplace
models. :param Config config: Config object orNone
to use environment config (default).-
model_class
¶ alias of
connect.models.marketplace.Marketplace
-
-
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
-
list
(product_id)¶ List an activation template. :param str product_id: Primary key of the product to search for. :return: response object with templates contents.
-
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:
-
-
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 aconnect.models.TierConfigRequest
request as argument and must return anconnect.models.ActivationTemplateResponse
orconnect.models.ActivationTileResponse
object in case the request has to be approved.In other case, you must raise one of these exceptions:
connect.exceptions.InquireRequest
: Inquire for more information.connect.exceptions.FailRequest
: Causes the request to fail.connect.exceptions.SkipRequest
: Skips processing the request.
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.
-
filters
(status='pending', **kwargs)¶ Returns the default set of filters for Tier Config request, plus any others that you might specify. The allowed filters are:
- type
- status
- id
- configuration.id
- configuration.tier_level
- configuration.account.id
- configuration.product.id
- assignee.id
- unassigned (bool)
- configuration.account.external_uid
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]
-
model_class
¶ alias of
connect.models.tier_config_request.TierConfigRequest
-
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]
- status (str) – Status of the requests. Default:
-
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_file.UsageFile
-
submit_usage
(usage_file, usage_records)¶ Submit a usage file.
Parameters: - usage_file (UsageFile) – Usage file.
- usage_records (list[UsageRecord]) – Records.
Returns: Usage file.
Return type: 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]
- status (str) – Status of the requests. Default:
-
model_class
¶ alias of
connect.models.usage_file.UsageFile
-
-
class
connect.resources.
BillingRequest
(**kwargs)¶ BillingRequest object.
-
asset
= None¶ (object) Billing Request Asset.
-
attrubutes
= None¶ (object) Billing Request Attributes.
-
events
= None¶ (object) Billing Request Events.
-
item
= None¶ (object) Billing Request Item.
-
period
= None¶ (object) Billing Request Period.
-
type
= None¶ (vendor|provider) Billing Request type.
-
-
class
connect.resources.
RecurringAsset
(**kwargs)¶ RecurringAsset object.
-
billing
= None¶ (object) Billing Request billing.
-
connection
= None¶ (object) Billing Request connection.
-
contract
= None¶ (object) Billing Request Contract.
-
events
= None¶ (object) Billing Request Events.
-
external_id
= None¶ (str) External Id.
-
external_uuid
= None¶ (str) External uuId.
-
items
= None¶ (object) Billing Request Item.
-
marketplace
= None¶ (object) Billing Request marketplace.
-
params
= None¶ (object) Billing Request Params.
-
product
= None¶ (object) product.
-
status
= None¶ (vendor|provider) Billing Request status.
-
tiers
= None¶ (object) Billing Request tiers.
-
-
class
connect.resources.
AssetRequestResource
(config=None)¶ Asset Request Resource.
-
model_class
¶ alias of
connect.models.asset_request.AssetRequest
-
update_param_asset_request
(request_id, data, note)¶ Update Asset Request param :param str id_request: Primary key of the request to update. :param str data: params to update.
- {
- “params”: [{
- “id”: “PM-9861-7949-8492-0001”, “value”: “32323323”
}]
}
Returns: Asset Request Attributes Object.
-
rql¶
-
class
connect.rql.
Query
(properties=None)¶ The Query class allows you to specify filters using the Resource Query Language syntax.
Parameters: properties (dict) – Initial list of input properties -
compile
()¶ Returns: A string representation of the query. Return type: str
-
equal
(prop, value)¶ Select objects with a property value equal to value.
Parameters: - prop (str) – Property.
- value (str) – Value.
Returns: The Query object to provide a fluent interface (chaining method calls).
Return type:
-
greater
(prop, value)¶ Select objects with a property value greater than the value.
Parameters: - prop (str) – Property.
- value (str) – Value.
Returns: The Query object to provide a fluent interface (chaining method calls).
Return type:
-
greater_equal
(prop, value)¶ Select objects with a property value equal or greater than the value.
Parameters: - prop (str) – Property.
- value (str) – Value.
Returns: The Query object to provide a fluent interface (chaining method calls).
Return type:
-
ilike
(prop, pattern)¶ Same as like but case unsensitive.
Parameters: - prop (str) – Property.
- pattern (str) – Pattern.
Returns: The Query object to provide a fluent interface (chaining method calls).
Return type:
-
in_
(prop, values)¶ Select objects where the specified property value is in the provided array.
Parameters: - prop (str) – Property
- values (list) – Values
Returns: The Query object to provide a fluent interface (chaining method calls).
Return type:
-
lesser
(prop, value)¶ Select objects with a property value less than the value.
Parameters: - prop (str) – Property.
- value (str) – Value.
Returns: The Query object to provide a fluent interface (chaining method calls).
Return type:
-
lesser_equal
(prop, value)¶ Select objects with a property value equal or lesser than the value.
Parameters: - prop (str) – Property.
- value (str) – Value.
Returns: The Query object to provide a fluent interface (chaining method calls).
Return type:
-
like
(prop, pattern)¶ Search for the specified pattern in the specified property. The function is similar to the SQL LIKE operator, though it uses the * wildcard instead of %. To specify in a pattern the * symbol itself, it must be percent-encoded, that is, you need to specify %2A instead of *, see the usage examples below. In addition, it is possible to use the ? wildcard in the pattern to specify that any symbol will be valid in this position.
Parameters: - prop (str) – Property.
- pattern (str) – Pattern.
Returns: The Query object to provide a fluent interface (chaining method calls).
Return type:
-
limit
(amount)¶ Indicates the given number of objects from the start position.
Parameters: amount (int) – Amount of objects to return. Returns: The Query object to provide a fluent interface (chaining method calls). Return type: Query
-
not_equal
(prop, value)¶ Select objects with a property value not equal to value.
Parameters: - prop (str) – Property.
- value (str) – Value.
Returns: The Query object to provide a fluent interface (chaining method calls).
Return type:
-
offset
(page)¶ Offset (page) to return on paged queries.
Parameters: page (int) – Offset. Returns: The Query object to provide a fluent interface (chaining method calls). Return type: Query
-
order_by
(prop)¶ Order list by given property.
Parameters: prop (str) – Property. Returns: The Query object to provide a fluent interface (chaining method calls). Return type: Query
-
ordering
(props)¶ Order list of objects by the given properties (unlimited number of properties). The list is ordered first by the first specified property, then by the second, and so on. The order is specified by the prefix: + ascending order, - descending.
Parameters: props (list) – Properties. Returns: The Query object to provide a fluent interface (chaining method calls). Return type: Query
-
out
(prop, values)¶ Select objects where the specified property value is not in the provided array.
Parameters: - prop (str) – Property
- values (list) – Values
Returns: The Query object to provide a fluent interface (chaining method calls).
Return type:
-
select
(attributes)¶ The function is applicable to a list of resources (hereafter base resources). It receives the list of attributes (up to 100 attributes) that can be primitive properties of the base resources, relation names, and relation names combined with properties of related resources. The output is the list of objects presenting the selected properties and related (linked) resources. Normally, when relations are selected, the base resource properties are also presented in the output.
Parameters: attributes (list) – Attributes. Returns: The Query object to provide a fluent interface (chaining method calls). Return type: Query
-