Skip to content

Commit

Permalink
Merge pull request #279 from KBbitsP/master
Browse files Browse the repository at this point in the history
Python Snippets for Catalog.md
  • Loading branch information
reshmabidikar authored Nov 1, 2023
2 parents 39ca43c + 79b14cd commit a3c979a
Showing 1 changed file with 57 additions and 45 deletions.
102 changes: 57 additions & 45 deletions source/includes/_catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,14 @@ KillBillClient::Model::Catalog.upload_tenant_catalog(catalog_file_xml,
```

```python
catalogApi = killbill.api.CatalogApi()
catalogApi = killbill.CatalogApi()

xml_catalog = open("../resources/SpyCarBasic.xml", "r+").read()

catalogApi.upload_catalog_xml(xml_catalog,
created_by,
api_key,
api_secret)
created_by='demo',
reason='reason',
comment='comment')
```

**Request Body**
Expand Down Expand Up @@ -169,9 +170,9 @@ KillBillClient::Model::Catalog.get_tenant_catalog_xml(requested_date,
```

```python
catalogApi = killbill.api.CatalogApi()
catalogApi = killbill.CatalogApi()

catalogApi.get_catalog_xml(api_key, api_secret)
catalog_xml = catalogApi.get_catalog_xml()
```
> Example Response:
Expand Down Expand Up @@ -446,9 +447,9 @@ KillBillClient::Model::Catalog.get_tenant_catalog_json.(requested_date,
```

```python
catalogApi = killbill.api.CatalogApi()
catalogApi = killbill.CatalogApi()

catalogApi.get_catalog_json(api_key, api_secret)
catalog_json = catalogApi.get_catalog_json()
```
> Example Response:
Expand Down Expand Up @@ -657,9 +658,9 @@ KillBillClient::Model::Catalog.get_tenant_catalog_versions(options)
```

```python
catalogApi = killbill.api.CatalogApi()
catalogApi = killbill.CatalogApi()

catalogApi.get_catalog_versions(api_key, api_secret)
catalog_versions = catalogApi.get_catalog_versions()
```

> Example Response:
Expand Down Expand Up @@ -714,9 +715,9 @@ KillBillClient::Model::Catalog.available_base_plans(options)
```

```python
catalogApi = killbill.api.CatalogApi()
catalogApi = killbill.CatalogApi()

catalogApi.get_available_base_plans(api_key, api_secret)
available_base_plans = catalogApi.get_available_base_plans()
```

> Example Response:
Expand Down Expand Up @@ -808,11 +809,9 @@ KillBillClient::Model::Catalog.available_addons(base_product_name,
```

```python
catalogApi = killbill.api.CatalogApi()
catalogApi = killbill.CatalogApi()

catalogApi.get_available_addons(api_key,
api_secret,
base_product_name='Basic')
available_add_on_plans = catalogApi.get_available_addons(base_product_name='Basic')
```
> Example Response:
Expand Down Expand Up @@ -882,9 +881,11 @@ KillBillClient::Model::Catalog.delete_catalog(user,
```

```python
catalogApi = killbill.api.CatalogApi()
catalogApi = killbill.CatalogApi()

catalogApi.delete_catalog(created_by, api_key, api_secret)
catalogApi.delete_catalog(created_by='demo',
reason='reason',
comment='comment')
```

**Query Parameters**
Expand Down Expand Up @@ -941,7 +942,14 @@ TODO
```

```python
TODO
catalogApi = killbill.CatalogApi()

xml_catalog = open("H:/killbill/catalog.xml", "r+").read()

catalog_validation_errors = catalogApi.validate_catalog_xml(xml_catalog,
created_by='demo',
reason='reason',
comment='comment')
```
> Example Response:
Expand Down Expand Up @@ -1004,11 +1012,11 @@ KillBillClient::Model::Catalog.get_catalog_phase(subscription_id,
```

```python
catalogApi = killbill.api.CatalogApi()
catalogApi = killbill.CatalogApi()

catalogApi.get_phase_for_subscription_and_date(api_key,
api_secret,
subscription_id=subscription_id)
subscription_id = 'ad924bca-00f4-4287-82c2-e2932a5f7371'

phase = catalogApi.get_phase_for_subscription_and_date(subscription_id=subscription_id)
```

> Example Response:
Expand Down Expand Up @@ -1070,11 +1078,11 @@ KillBillClient::Model::Catalog.get_catalog_plan(subscription_id,
```

```python
catalogApi = killbill.api.CatalogApi()
catalogApi = killbill.CatalogApi()

subscription_id = 'ad924bca-00f4-4287-82c2-e2932a5f7371'

catalogApi.get_plan_for_subscription_and_date(api_key,
api_secret,
subscription_id=subscription_id)
plan = catalogApi.get_plan_for_subscription_and_date(subscription_id=subscription_id)
```

> Example Response:
Expand Down Expand Up @@ -1162,11 +1170,11 @@ KillBillClient::Model::Catalog.get_catalog_price_list(subscription_id,
```

```python
catalogApi = killbill.api.CatalogApi()
catalogApi = killbill.CatalogApi()

catalogApi.get_price_list_for_subscription_and_date(api_key,
api_secret,
subscription_id=subscription_id)
subscription_id = 'ad924bca-00f4-4287-82c2-e2932a5f7371'

price_list = catalogApi.get_price_list_for_subscription_and_date(subscription_id=subscription_id)
```

> Example Response:
Expand Down Expand Up @@ -1224,11 +1232,11 @@ KillBillClient::Model::Catalog.get_catalog_product(subscription_id,
```

```python
catalogApi = killbill.api.CatalogApi()
catalogApi = killbill.CatalogApi()

subscription_id = 'ad924bca-00f4-4287-82c2-e2932a5f7371'

catalogApi.get_product_for_subscription_and_date(api_key,
api_secret,
subscription_id=subscription_id)
product = catalogApi.get_product_for_subscription_and_date(subscription_id=subscription_id)
```

> Example Response:
Expand Down Expand Up @@ -1341,17 +1349,21 @@ KillBillClient::Model::Catalog.add_tenant_catalog_simple_plan(simple_plan,
options)
```
```python
catalogApi = killbill.api.CatalogApi()
body = SimplePlan(plan_id='basic-annual',
product_name='Basic',
product_category='BASE',
currency='USD',
amount=10000.00,
billing_period='ANNUAL',
trial_length=0,
trial_time_unit='UNLIMITED')
catalogApi = killbill.CatalogApi()

body = killbill.SimplePlan(plan_id='basic-annual',
product_name='Basic',
product_category='BASE',
currency='USD',
amount=10000.00,
billing_period='ANNUAL',
trial_length=0,
trial_time_unit='UNLIMITED')

catalogApi.add_simple_plan(body, created_by, api_key, api_secret)
catalogApi.add_simple_plan(body,
created_by='demo',
reason='reason',
comment='comment')
```

**Request Body**
Expand Down

0 comments on commit a3c979a

Please sign in to comment.