
### delete <a name="delete"></a>
Delete a service account



**API Endpoint**: `DELETE /service_account/{id}`

#### Example Snippet

```rust
let client = sideko_rest_api::SidekoClient::default()
    .with_api_key_auth(&std::env::var("API_KEY").unwrap())
    .with_cookie_auth(&std::env::var("API_KEY").unwrap());
let res = client
    .service_account()
    .delete(sideko_rest_api::resources::service_account::DeleteRequest {
        id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(),
    })
    .await;
```

### list <a name="list"></a>
List all service accounts in organization



**API Endpoint**: `GET /service_account`

#### Example Snippet

```rust
let client = sideko_rest_api::SidekoClient::default()
    .with_api_key_auth(&std::env::var("API_KEY").unwrap())
    .with_cookie_auth(&std::env::var("API_KEY").unwrap());
let res = client.service_account().list().await;
```

### get <a name="get"></a>
Get service account by the ID



**API Endpoint**: `GET /service_account/{id}`

#### Example Snippet

```rust
let client = sideko_rest_api::SidekoClient::default()
    .with_api_key_auth(&std::env::var("API_KEY").unwrap())
    .with_cookie_auth(&std::env::var("API_KEY").unwrap());
let res = client
    .service_account()
    .get(sideko_rest_api::resources::service_account::GetRequest {
        id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(),
    })
    .await;
```

### create <a name="create"></a>
Create a new service account with a set of project permissions



**API Endpoint**: `POST /service_account`

#### Example Snippet

```rust
let client = sideko_rest_api::SidekoClient::default()
    .with_api_key_auth(&std::env::var("API_KEY").unwrap())
    .with_cookie_auth(&std::env::var("API_KEY").unwrap());
let res = client
    .service_account()
    .create(sideko_rest_api::resources::service_account::CreateRequest {
        name: "Documentation Publisher Service Account".to_string(),
        object_roles: vec![
            sideko_rest_api::models::ObjectRole { object_id :
            "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), object_type :
            sideko_rest_api::models::ObjectTypeEnum::ApiProject, role_definition_id :
            sideko_rest_api::models::RoleDefinitionIdEnum::ApiProjectAdmin }
        ],
        ..Default::default()
    })
    .await;
```
