Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

sugerio/suger-sdk-python

Open more actions menu

Repository files navigation

suger-sdk-python

CRUD operations on a set of resources, including organizations, products, offers, entitlements, usage record groups for meterting, etc.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0
  • Package version: v3.128.222
  • Generator version: 7.20.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://www.suger.io/support

Requirements.

Python 3.9+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/sugerio/suger-sdk-python.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/sugerio/suger-sdk-python.git)

Then import the package:

import suger_sdk_python

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import suger_sdk_python

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import suger_sdk_python
from suger_sdk_python.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.suger.cloud
# See configuration.py for a list of all supported configuration parameters.
configuration = suger_sdk_python.Configuration(
    host = "https://api.suger.cloud"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: APIKeyAuth
configuration.api_key['APIKeyAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyAuth'] = 'Bearer'


# Enter a context with an instance of the API client
with suger_sdk_python.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = suger_sdk_python.AIUsageApi(api_client)
    org_id = 'org_id_example' # str | Organization ID
    start_time = 'start_time_example' # str | Start time (RFC3339 format)
    end_time = 'end_time_example' # str | End time (RFC3339 format)
    limit = 56 # int | Maximum number of records to return (default: 1000, max: 10000) (optional)
    offset = 56 # int | Number of records to skip for pagination (default: 0) (optional)

    try:
        # Get AI usage data
        api_response = api_instance.get_ai_usage(org_id, start_time, end_time, limit=limit, offset=offset)
        print("The response of AIUsageApi->get_ai_usage:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AIUsageApi->get_ai_usage: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.suger.cloud

Class Method HTTP request Description
AIUsageApi get_ai_usage GET /org/{orgId}/ai-usage Get AI usage data
APIApi get_api_client GET /org/{orgId}/apiClient/{apiClientId} get api client
APIApi list_api_clients GET /org/{orgId}/apiClient list api clients
AuditingApi query_auditing_events GET /org/{orgId}/auditingEvent/query query auditing events
BillingApi create_refund POST /org/{orgId}/buyer/{buyerId}/paymentTransaction/{paymentTransactionId}/refund create refund.
BillingApi get_invoice GET /org/{orgId}/invoice/{invoiceId} get invoice
BillingApi issue_invoice PATCH /org/{orgId}/invoice/{invoiceId}/issue issue invoice
BillingApi list_invoices GET /org/{orgId}/invoice list invoices
BillingApi list_payment_transactions GET /org/{orgId}/paymentTransaction list payment transactions
BillingApi list_refund_of_payment_transaction GET /org/{orgId}/buyer/{buyerId}/paymentTransaction/{paymentTransactionId}/refund list refunds.
BillingApi pay_invoice PATCH /org/{orgId}/invoice/{invoiceId}/pay pay invoice
BillingApi preview_invoice_email GET /org/{orgId}/invoice/{invoiceId}/preview preview invoice email
BillingApi update_invoice_info PATCH /org/{orgId}/invoice/{invoiceId}/info update invoice info
BillingApi void_invoice PATCH /org/{orgId}/invoice/{invoiceId}/void void invoice
BuyerApi close_credit_wallet PATCH /org/{orgId}/buyer/{buyerId}/wallet/{walletId}/close close credit wallet
BuyerApi create_buyer POST /org/{orgId}/buyer create buyer
BuyerApi create_credit_wallet POST /org/{orgId}/buyer/{buyerId}/wallet create credit wallet
BuyerApi delete_buyer_wallet DELETE /org/{orgId}/buyer/{buyerId}/wallet/{walletId} delete buyer wallet
BuyerApi get_buyer GET /org/{orgId}/buyer/{buyerId} get buyer
BuyerApi list_buyer_wallets GET /org/{orgId}/buyer/{buyerId}/wallet list buyer's wallets
BuyerApi list_buyers GET /org/{orgId}/buyer list buyers
BuyerApi query_buyers GET /org/{orgId}/buyer/query query buyers
BuyerApi set_buyer_default_wallet PATCH /org/{orgId}/buyer/{buyerId}/wallet/{walletId}/default set buyer default wallet
BuyerApi update_buyer PATCH /org/{orgId}/buyer/{buyerId} update buyer
BuyerApi update_credit_wallet PATCH /org/{orgId}/buyer/{buyerId}/wallet/{walletId} update credit wallet
CRMEnrichmentApi org_org_id_crm_enrichment_on_demand_post POST /org/{orgId}/crm/enrichment/on-demand Trigger on-demand CRM record enrichment
CRMEnrichmentApi org_org_id_integration_partner_service_enrichment_progress_get GET /org/{orgId}/integration/{partner}/{service}/enrichment/progress Get CRM enrichment progress
CRMEnrichmentApi org_org_id_integration_partner_service_enrichment_validate_query_post POST /org/{orgId}/integration/{partner}/{service}/enrichment/validate-query Validate CRM query
CatalogApi get_vendor_details GET /org/{orgId}/catalog/vendor/{vendorId} get vendor details
CatalogApi list_vendors GET /org/{orgId}/catalog/vendor list vendors
ContactApi add_contact_to_buyer POST /org/{orgId}/contact/{contactId}/buyer/{buyerId} add contact to buyer
ContactApi add_contact_to_offer POST /org/{orgId}/contact/{contactId}/offer/{offerId} add contact to offer
ContactApi batch_create_contacts POST /org/{orgId}/contact/batch batch create contacts
ContactApi create_contact POST /org/{orgId}/contact create contact
ContactApi get_contact GET /org/{orgId}/contact/{contactId} get contact
ContactApi list_contacts GET /org/{orgId}/contact list contacts
ContactApi query_contacts GET /org/{orgId}/contact/query query contacts
ContactApi remove_contact_from_buyer DELETE /org/{orgId}/contact/{contactId}/buyer/{buyerId} remove contact from buyer
ContactApi remove_contact_from_offer DELETE /org/{orgId}/contact/{contactId}/offer/{offerId} remove contact from offer
ContactApi update_contact PATCH /org/{orgId}/contact/{contactId} update contact
ContactApi update_contact_tags PATCH /org/{orgId}/contact/{contactId}/tag update contact tags
CosellApi org_org_id_cosell_partner_aws_search_partner_post POST /org/{orgId}/cosell/partner/AWS/searchPartner Search partner connections
EntitlementApi add_entitlement_credit POST /org/{orgId}/entitlement/{entitlementId}/addCredit add entitlement credit
EntitlementApi apply_addon_to_entitlement POST /org/{orgId}/entitlement/{entitlementId}/addon apply addon to entitlement
EntitlementApi approve_entitlement POST /org/{orgId}/entitlement/{entitlementId}/approve approve entitlement
EntitlementApi cancel_entitlement POST /org/{orgId}/entitlement/{entitlementId}/cancel cancel entitlement
EntitlementApi create_entitlement POST /org/{orgId}/entitlement create entitlement
EntitlementApi delete_entitlement_term DELETE /org/{orgId}/entitlement/{entitlementId}/entitlementTerm/{entitlementTermId} delete entitlement term
EntitlementApi divide_entitlement_commit POST /org/{orgId}/entitlement/{entitlementId}/divideCommit divide entitlement commit
EntitlementApi get_entitlement GET /org/{orgId}/entitlement/{entitlementId} get entitlement
EntitlementApi get_entitlement_term GET /org/{orgId}/entitlement/{entitlementId}/entitlementTerm/{entitlementTermId} get entitlement term
EntitlementApi list_entitlement_terms GET /org/{orgId}/entitlement/{entitlementId}/entitlementTerm list entitlement terms
EntitlementApi list_entitlements GET /org/{orgId}/entitlement list entitlements
EntitlementApi query_entitlements GET /org/{orgId}/entitlement/query query entitlements
EntitlementApi schedule_entitlement_cancellation POST /org/{orgId}/entitlement/{entitlementId}/scheduleCancellation schedule entitlement cancellation
EntitlementApi unschedule_entitlement_cancellation POST /org/{orgId}/entitlement/{entitlementId}/unscheduleCancellation unschedule entitlement cancellation
EntitlementApi update_entitlement_meta_info PATCH /org/{orgId}/entitlement/{entitlementId}/metaInfo update entitlement meta info
EntitlementApi update_entitlement_name PATCH /org/{orgId}/entitlement/{entitlementId}/entitlementName update entitlement name
EntitlementApi update_entitlement_price_model PATCH /org/{orgId}/entitlement/{entitlementId}/priceModel update entitlement price model
EntitlementApi update_entitlement_seat PATCH /org/{orgId}/entitlement/{entitlementId}/seat update seat for the active AZURE subscription
MeteringApi aggregate_usage_record_groups GET /org/{orgId}/usageRecordGroup/aggregate aggregate usageRecordGroups
MeteringApi aggregate_usage_record_reports GET /org/{orgId}/usageRecordReport/aggregate aggregate usageRecordReports
MeteringApi batch_report_usage_record_groups POST /org/{orgId}/batchCreateUsageRecordGroups batch report usageRecordGroups
MeteringApi batch_validate_usage_record_groups POST /org/{orgId}/batchValidateUsageRecordGroups batch validate usageRecordGroups
MeteringApi create_billable_metric POST /org/{orgId}/billableMetric create billable metric
MeteringApi delete_usage_record_group DELETE /org/{orgId}/usageRecordGroup/{usageRecordGroupId} delete usageRecordGroup
MeteringApi get_billable_metric GET /org/{orgId}/billableMetric/{billableMetricId} get billable metric
MeteringApi get_usage_metering_config_info GET /org/{orgId}/usageMeteringConfigInfo get usage metering config info
MeteringApi list_billable_metrics GET /org/{orgId}/billableMetric list billable metrics
MeteringApi list_usage_record_groups GET /org/{orgId}/usageRecordGroup list usageRecordGroups
MeteringApi list_usage_record_reports GET /org/{orgId}/usageRecordReport list usageRecordReports
MeteringApi report_usage_record_group POST /org/{orgId}/entitlement/{entitlementId}/usageRecordGroup report usageRecordGroup
MeteringApi retry_usage_record_group POST /org/{orgId}/usageRecordGroup/{usageRecordGroupId}/retry retry usageRecordGroup
MeteringApi update_billable_metric PATCH /org/{orgId}/billableMetric/{billableMetricId} update billable metric
MeteringApi update_usage_metering_config_info PATCH /org/{orgId}/usageMeteringConfigInfo update usage metering config info
NotificationApi get_notification_message GET /org/{orgId}/notificationMessage/{notificationMessageId} get notification message
NotificationApi list_notification_events GET /org/{orgId}/notificationEvent list notification events
NotificationApi list_notification_events_by_entity GET /org/{orgId}/notificationEvent/{entityType}/{entityId} list notification events by entity
NotificationApi list_notification_messages GET /org/{orgId}/notificationMessage list notification messages
OfferApi cancel_offer POST /org/{orgId}/offer/{offerId}/cancel cancel offer
OfferApi create_offer POST /org/{orgId}/offer create offer
OfferApi create_or_update_draft_offer POST /org/{orgId}/draftOffer create or update draft offer
OfferApi delete_offer DELETE /org/{orgId}/offer/{offerId} delete offer
OfferApi extend_private_offer_expiry_date POST /org/{orgId}/offer/{offerId}/extendExpiryDate extend offer expiry date
OfferApi get_offer GET /org/{orgId}/offer/{offerId} get offer
OfferApi get_offer_by_external_id GET /org/{orgId}/offerExternalId/{offerExternalId} get offer by external ID
OfferApi get_offer_eula GET /org/{orgId}/offer/{offerId}/eula get offer EULA
OfferApi get_offer_reseller_eula GET /org/{orgId}/offer/{offerId}/resellerEula get offer reseller EULA
OfferApi list_offers GET /org/{orgId}/offer list offers
OfferApi query_offers GET /org/{orgId}/offer/query query offers
OfferApi send_offer_notifications POST /org/{orgId}/offer/{offerId}/notifyContacts notify offer contacts
OfferApi sync_offer POST /org/{orgId}/offer/{offerId}/sync sync offer from its partner. Such as AWS marketplace, Azure marketplace or GCP marketplace.
OfferApi update_offer_meta_info PATCH /org/{orgId}/offer/{offerId}/metaInfo update offer meta info
OperationApi get_operation_v2 GET /org/{orgId}/v2/operation/{operationId} get operation details
OperationApi list_operation_history_v2 GET /org/{orgId}/v2/operation/{operationId}/history get operation history events
OperationApi list_operations_v2 POST /org/{orgId}/v2/operation/list list operations with filters
ProductApi create_or_update_draft_product POST /org/{orgId}/draftProduct create or update draft product
ProductApi create_product POST /org/{orgId}/product create product
ProductApi delete_product DELETE /org/{orgId}/product/{productId} delete product
ProductApi get_product GET /org/{orgId}/product/{productId} get product
ProductApi list_product_metering_dimensions GET /org/{orgId}/product/{productId}/dimension list metering dimensions of product
ProductApi list_products GET /org/{orgId}/product list products
ProductApi list_products_by_partner GET /org/{orgId}/partner/{partner}/product list products by partner
ProductApi publish_product PATCH /org/{orgId}/product/{productId}/publish publish product
ProductApi query_products GET /org/{orgId}/product/query query products
ProductApi update_product PATCH /org/{orgId}/product/{productId} update product
ProductApi update_product_fulfillment_url PATCH /org/{orgId}/product/{productId}/fulfillmentUrl update product fulfillment url
ProductApi update_product_meta_info PATCH /org/{orgId}/product/{productId}/metaInfo update product meta info
QuotaApi org_org_id_quota_get GET /org/{orgId}/quota List organization quotas
ReportApi get_revenue_report POST /org/{orgId}/revenueReport get revenue report
ReportApi list_daily_revenue_records GET /org/{orgId}/dailyRevenueRecord list daily revenue records
ReportApi list_revenue_record_details GET /org/{orgId}/partner/{partner}/revenueRecordDetail list revenue record details
ReportApi list_revenue_records GET /org/{orgId}/partner/{partner}/revenueRecord list revenue records
ReportApi list_usage_metering_daily_records GET /org/{orgId}/partner/{partner}/usageMeteringDailyRecord list usage metering daily records
SearchApi list_searchable_objects GET /org/{orgId}/search Global search
SupportApi close_support_ticket PATCH /org/{orgId}/support/ticket/{ticketId}/close close support ticket
SupportApi create_support_ticket POST /org/{orgId}/support/ticket create support ticket
SupportApi create_support_ticket_attachment POST /org/{orgId}/support/ticket/{ticketId}/attachment create support ticket attachment
SupportApi create_support_ticket_comment POST /org/{orgId}/support/ticket/{ticketId}/comment create support ticket comment
SupportApi get_support_ticket GET /org/{orgId}/support/ticket/{ticketId} get support ticket
SupportApi list_support_tickets GET /org/{orgId}/support/ticket list support tickets
SupportApi reopen_support_ticket PATCH /org/{orgId}/support/ticket/{ticketId}/reopen reopen support ticket
SupportApi update_support_ticket PATCH /org/{orgId}/support/ticket/{ticketId} update support ticket
VendorApi get_vendor_product GET /org/{orgId}/vendor/{vendorId}/product/{productId} get vendor product
VendorApi list_vendor_products GET /org/{orgId}/vendor/{vendorId}/product list vendor products

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

APIKeyAuth

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Author

support@suger.io

About

Suger API SDK in Python3

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.