Esta é uma API de gerenciamento classes do DBC.
API de listagem de classes.
Exemplo de requisição
GET /api/dbc/classes HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
response = sdk.dbc.get_classes()
print(response.payload)
const response = sdk.dbc.getClasses();
console.log(response.payload);
Exemplo de resposta
HTTP/1.1 200 OK
Content-Type: application/json
{
"classes": [
{
"id": 1,
"name": "class01",
"created_at": "2017-10-05T12:20:02.932000+00:00",
"updated_at": "2017-11-05T12:20:02.932000+00:00",
},
],
}
[
Class(
id=1,
name="class01",
created_at=DateTime(2017, 10, 5, 12, 20, 2, tzinfo=Timezone('+00:00')),
updated_at=DateTime(2017, 10, 5, 12, 20, 2, tzinfo=Timezone('+00:00')),
)
]
[
{
id: 1,
name: "class01",
createdAt: "2017-10-05T15:20:02.000Z",
updatedAt: "2017-11-05T15:20:02.000Z"
}
];
API de busca de uma classe existente.
id
Exemplo de requisição
GET /api/dbc/classes/1 HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
response = sdk.dbc.get_class(id=1)
print(response.payload)
const response = sdk.dbc.getClass({ id: 1 });
console.log(response.payload);
Exemplo de resposta
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"name": "class01",
"created_at": "2017-10-05T12:20:02.932000+00:00",
"updated_at": "2017-11-05T12:20:02.932000+00:00",
}
Class(
id=1,
name="class01",
created_at=DateTime(2017, 10, 5, 12, 20, 2, tzinfo=Timezone('+00:00')),
updated_at=DateTime(2017, 10, 5, 12, 20, 2, tzinfo=Timezone('+00:00')),
)
{
id: 1,
name: "class01",
createdAt: "2017-10-05T15:20:02.000Z",
updatedAt: "2017-11-05T15:20:02.000Z"
}
API de cadastro de uma classe.
Exemplo de requisição
POST /api/dbc/classes HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
{
"name": "class01",
"apply": false,
}
from itflex_sdk.dbc.types import CreateClassRequest
request = CreateClassRequest(
name="class01",
apply=False,
)
response = sdk.dbc.create_class(request)
print(response.payload)
const class = sdk.dbc.types.Class();
class.name = "class01";
class.apply = false;
const response = sdk.dbc.createClass(class);
console.log(response.payload);
Exemplo de resposta
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"name": "class01",
"created_at": "2017-10-05T12:20:02.932000+00:00",
"updated_at": "2017-11-05T12:20:02.932000+00:00",
}
Class(
id=1,
name="class01",
created_at=DateTime(2017, 10, 5, 12, 20, 2, tzinfo=Timezone('+00:00')),
updated_at=DateTime(2017, 10, 5, 12, 20, 2, tzinfo=Timezone('+00:00')),
)
{
id: 1,
name: "class01",
createdAt: "2017-10-05T15:20:02.000Z",
updatedAt: "2017-11-05T15:20:02.000Z"
}
API de edição de uma classe existente.
id
Exemplo de requisição
PUT /api/dbc/classes/1 HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
{
"name": "class01_updated",
"apply": false,
}
from itflex_sdk.dbc.types import UpdateClassRequest
request = UpdateClassRequest(
id=1,
name="class01_updated",
apply=False,
)
response = sdk.dbc.update_class(request)
print(response.payload)
const class = {
id: 1,
name: "class01_updated",
apply: false,
};
const response = sdk.dbc.updateClass(class);
console.log(response.payload);
Exemplo de resposta
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"name": "class01_updated",
"created_at": "2017-10-05T12:20:02.932000+00:00",
"updated_at": "2017-11-05T12:20:02.932000+00:00",
}
Class(
id=1,
name="class01_updated",
created_at=DateTime(2017, 10, 5, 12, 20, 2, tzinfo=Timezone('+00:00')),
updated_at=DateTime(2017, 11, 5, 12, 20, 2, tzinfo=Timezone('+00:00')),
)
{
id: 1,
name: "class01_updated",
}
API de exclusão de uma classe existente.
id
Exemplo de requisição
DELETE /api/dbc/classes/1 HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
response = sdk.dbc.delete_class(id=1)
const response = sdk.dbc.deleteClass({ id: 1 });
Exemplo de resposta
HTTP/1.1 200 OK
Content-Type: application/json
Parâmetros da url
Campo | Descrição |
---|---|
id | int Idendificador da regra |
Requisição
Campo | Descrição |
---|---|
id | int Idendificador da classe |
Campo | Descrição |
---|---|
id | stringrequerido único Nome da classe |
apply | bool Flag que indica se as informações serão provisionadas imediatamente após a criação ou edição Valor padrão: |
Resposta
Campo | Descrição |
---|---|
id | int Idendificador da classe |
Campo | Descrição |
---|---|
id | string Nome da classe |
created_at | string Data de criação
|
updated_at | string Data da última edição
|