# Billing

> **Package : spaceone.api.billing.plugin**

## Billing

{% hint style="info" %}
**Billing Methods:**
{% endhint %}

| NO | Method                     | Request Type                              | Response Type                                           | Description |
| -- | -------------------------- | ----------------------------------------- | ------------------------------------------------------- | ----------- |
| 1  | [**get\_data**](#get_data) | [BillingDataRequest](#billingdatarequest) | [PluginBillingDataResponse](#pluginbillingdataresponse) |             |

### get\_data

| Type     | Message                                                 |
| -------- | ------------------------------------------------------- |
| Request  | [BillingDataRequest](#billingdatarequest)               |
| Response | [PluginBillingDataResponse](#pluginbillingdataresponse) |

## Message

### BillingData

| No | Field    | Type   | Required | Description |
| -- | -------- | ------ | :------: | ----------- |
| 1  | date     | string |     ✅    |             |
| 2  | cost     | double |     ✅    |             |
| 3  | currency | string |     ❌    |             |

### BillingDataRequest

| No | Field        | Type                                                                                                               | Required | Description                 |
| -- | ------------ | ------------------------------------------------------------------------------------------------------------------ | :------: | --------------------------- |
| 1  | options      | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |     ✅    |                             |
| 2  | secret\_data | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |     ✅    |                             |
| 3  | filter       | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |     ❌    |                             |
| 4  | aggregation  | list of string                                                                                                     |     ❌    |                             |
| 5  | start        | string                                                                                                             |     ❌    | billing period's start date |
| 6  | end          | string                                                                                                             |     ✅    | billing period's end date   |
| 7  | granularity  | string                                                                                                             |     ❌    |                             |
| 8  | schema       | string                                                                                                             |     ❌    |                             |

### BillingInfo

| No | Field          | Type                                | Required | Description |
| -- | -------------- | ----------------------------------- | :------: | ----------- |
| 1  | resource\_type | string                              |     ✅    |             |
| 2  | billing\_data  | [list of BillingData](#billingdata) |     ✅    |             |
| 3  | name           | string                              |     ❌    |             |

### PluginBillingDataResponse

| No | Field        | Type                                                                                            | Required | Description |
| -- | ------------ | ----------------------------------------------------------------------------------------------- | :------: | ----------- |
| 1  | results      | [list of BillingInfo](#billinginfo)                                                             |     ✅    |             |
| 2  | total\_count | [int32](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/type.proto) |     ✅    |             |
