Metadata-Version: 2.1
Name: feature-insights-iapi
Version: 0.0.5rc1
Summary: IAPI Interface Files
Home-page: https://github.com/Cloudzero/feature-insights
Author: CloudZero
Author-email: support@cloudzero.com
License: UNLICENSED
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Description-Content-Type: text/markdown
Requires-Dist: cz-common-python >=0.10.22


# Insights IAPI

This package contains the interface for the Insights iAPI. 

## Installing and Use
Add `feature_insights_iapi` to your requirements file or run `pip install feature_insights_iapi`. To use, add `from feature_insights_iapi import insights_client`.

## Commands


### Get

**Command**: `get_insight`

**Arguments**: 
- `cz_organization_id`: `str`
- `insight_id`: `str`

**Usage**: `insights_client.get_insight(cz_organization_id=1234568906, insight_id=2938547489534)`


### Create
**Command**: `create_insight`

**Arguments**:
- `cz_organization_id`: `str`
- `insight`: `dict` (*for most up to date `insight` structure, refer to* [CREATE_INSIGHT](https://github.com/Cloudzero/feature-insights/blob/develop/src/common/insights.py#L149-L158))
```python
{
    Required('status', default='new'): schema.VALID_STATUS,
    Optional('effort'): schema.VALID_EFFORT,
    Optional('cost_impact'): schema.CURRENCY,
    'description': str,
    'category': str,
    'title': str,
    Optional('link'): schema.CZ_LINK,
    Optional('source'): str
}
```

**Request**: `insights_client.create_insight(cz_organization_id=<cz_organization_id>, insight=<insight>)`

**Response** (*for the most up to date response, refer to* [INSIGHT_RESPONSE](https://github.com/Cloudzero/feature-insights/blob/develop/src/common/insights.py#L23-L33])): 
```python
{
  'insight': {
      'id': str
      'status': schema.VALID_STATUS,
      Optional('effort'): schema.VALID_EFFORT,
      Optional('cost_impact'): schema.CURRENCY,
      'title': str,
      'description': str,
      'created': Number(),
      'last_updated': Number(),
      Optional('link'): Url(),
      Optional('source'): str
  }
}
```


### Update
**Command**: `update_insight`

**Arguments**:
- `cz_organization_id`: `str`
- `insight_id`: str
- `insight`: `dict` (*for most up to date `insight` structure, refer to* [INSIGHT_UPDATE_FIELDS](https://github.com/Cloudzero/feature-insights/blob/develop/src/common/insights.py#L125-L134))
```python
{
    'status': schema.VALID_STATUS,
    'effort': schema.VALID_EFFORT,
    'cost_impact': schema.CURRENCY,
    'category': str,
    'title': str,
    'description': str,
    'link': schema.CZ_LINK,
    'source': str
}
```

**Request**: `insights_client.update_insight(cz_organization_id=<cz_organization_id>, insight_id=<insight_id>, insight=<insight>)`

**Response** (*for the most up to date response, refer to* [INSIGHT_RESPONSE](https://github.com/Cloudzero/feature-insights/blob/develop/src/common/insights.py#L23-L33])): 
```python
{
  'insight': {
      'id': str
      'status': schema.VALID_STATUS,
      Optional('effort'): schema.VALID_EFFORT,
      Optional('cost_impact'): schema.CURRENCY,
      'title': str,
      'description': str,
      'created': Number(),
      'last_updated': Number(),
      Optional('link'): Url(),
      Optional('source'): str
  }
}
```
