# Distribution

This documentation outlines a set of API endpoints for managing and interacting with TRADE's Queue, including distribution management and status.

## POST /Distribution/Start

> Starts data distribution for a package.

```json
{"openapi":"3.0.1","info":{"title":"Customers","version":"v1.0"},"servers":[{"url":"https://stm-api.lsports.eu","variables":{"host":{"default":"https://stm-api.lsports.eu"}}}],"paths":{"/Distribution/Start":{"post":{"tags":["Distribution"],"summary":"Starts data distribution for a package.","requestBody":{"content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/UpdateDistributionPackageRequestDto"}},"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDistributionPackageRequestDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/UpdateDistributionPackageRequestDto"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/UpdateDistributionPackageRequestDto"}}}},"responses":{"200":{"description":"Success"}}}}},"components":{"schemas":{"UpdateDistributionPackageRequestDto":{"required":["packageId","password","userName"],"type":"object","properties":{"packageId":{"type":"integer","format":"int32"},"userName":{"minLength":1,"type":"string"},"password":{"minLength":1,"type":"string"}},"additionalProperties":false}}}}
```

## POST /Distribution/Stop

> Stops data distribution for a package.

```json
{"openapi":"3.0.1","info":{"title":"Customers","version":"v1.0"},"servers":[{"url":"https://stm-api.lsports.eu","variables":{"host":{"default":"https://stm-api.lsports.eu"}}}],"paths":{"/Distribution/Stop":{"post":{"tags":["Distribution"],"summary":"Stops data distribution for a package.","requestBody":{"content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/UpdateDistributionPackageRequestDto"}},"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDistributionPackageRequestDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/UpdateDistributionPackageRequestDto"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/UpdateDistributionPackageRequestDto"}}}},"responses":{"200":{"description":"Success","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/UpdateDistributionPackageResponseDtoStandardResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDistributionPackageResponseDtoStandardResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/UpdateDistributionPackageResponseDtoStandardResponse"}}}}}}}},"components":{"schemas":{"UpdateDistributionPackageRequestDto":{"required":["packageId","password","userName"],"type":"object","properties":{"packageId":{"type":"integer","format":"int32"},"userName":{"minLength":1,"type":"string"},"password":{"minLength":1,"type":"string"}},"additionalProperties":false},"UpdateDistributionPackageResponseDtoStandardResponse":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/ResponseHeader"},"body":{"$ref":"#/components/schemas/UpdateDistributionPackageResponseDto"}},"additionalProperties":false},"ResponseHeader":{"type":"object","properties":{"httpStatusCode":{"type":"integer","format":"int32"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ResponseError"},"nullable":true}},"additionalProperties":false},"ResponseError":{"type":"object","properties":{"message":{"type":"string","nullable":true}},"additionalProperties":false},"UpdateDistributionPackageResponseDto":{"type":"object","properties":{"message":{"type":"string","nullable":true}},"additionalProperties":false}}}}
```

## POST /Package/GetDistributionStatus

> See that status of messages distribution.

```json
{"openapi":"3.0.1","info":{"title":"Customers","version":"v1.0"},"servers":[{"url":"https://stm-api.lsports.eu","variables":{"host":{"default":"https://stm-api.lsports.eu"}}}],"paths":{"/Package/GetDistributionStatus":{"post":{"tags":["Package"],"summary":"See that status of messages distribution.","requestBody":{"content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/GetDistributionStatusRequestDto"}},"application/json":{"schema":{"$ref":"#/components/schemas/GetDistributionStatusRequestDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/GetDistributionStatusRequestDto"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/GetDistributionStatusRequestDto"}}}},"responses":{"200":{"description":"Success","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/GetDistributionStatusResponseDtoStandardResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/GetDistributionStatusResponseDtoStandardResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/GetDistributionStatusResponseDtoStandardResponse"}}}}}}}},"components":{"schemas":{"GetDistributionStatusRequestDto":{"required":["packageId","password","userName"],"type":"object","properties":{"packageId":{"type":"integer","format":"int32"},"userName":{"minLength":1,"type":"string"},"password":{"minLength":1,"type":"string"}},"additionalProperties":false},"GetDistributionStatusResponseDtoStandardResponse":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/ResponseHeader"},"body":{"$ref":"#/components/schemas/GetDistributionStatusResponseDto"}},"additionalProperties":false},"ResponseHeader":{"type":"object","properties":{"httpStatusCode":{"type":"integer","format":"int32"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ResponseError"},"nullable":true}},"additionalProperties":false},"ResponseError":{"type":"object","properties":{"message":{"type":"string","nullable":true}},"additionalProperties":false},"GetDistributionStatusResponseDto":{"type":"object","properties":{"isDistributionOn":{"type":"boolean"},"consumers":{"type":"array","items":{"type":"string"},"nullable":true},"numberMessagesInQueue":{"type":"integer","format":"int64"},"messagesPerSecond":{"type":"number","format":"double"}},"additionalProperties":false}}}}
```
