ServiceIdentities
Rust service_identities API reference: typed methods, request options, return values, and resource models.
goodmem::api::ServiceIdentities
Access this service with client.service_identities().
pub struct ServiceIdentities<'a> {
/* private fields */
}Methods
| Method | HTTP | Path |
|---|---|---|
create | POST | /v1/service-identities |
delete | DELETE | /v1/service-identities/{id} |
get | GET | /v1/service-identities/{id} |
list | GET | /v1/service-identities |
list_pages | GET | /v1/service-identities |
transfer_ownership | POST | /v1/service-identities/{id}:transferOwnership |
update | PUT | /v1/service-identities/{id} |
Errors and cancellation
Calls return Result<T>. See Error for validation, HTTP, transport, decoding, and timeout failures. Stream items can also return errors after the call succeeds.
Pagination helpers fetch pages when polled. Drop a page or event stream to cancel further work.
Implementations
impl ServiceIdentities<'_>
create
pub async fn create( &self, body: &CreateServiceIdentityRequest, ) ->Result<ServiceIdentityResponse>
Create a service identity
Creates one production-workload identity owned by the authenticated human. No API key, role, grant, or authentication mapping is created implicitly.
Errors include local validation, HTTP failures, and malformed responses.
HTTP: POST /v1/service-identities
delete
pub async fn delete(&self, id: impl std::fmt::Display) ->Result<()>
Delete a service identity
Permanently soft-deletes the principal. Its stored credentials remain audit records but can no longer authenticate because their subject is deleted. Repeating an authorized delete succeeds without rewriting audit data.
Errors include local validation, HTTP failures, and malformed responses.
HTTP: DELETE /v1/service-identities/{id}
get
pub async fn get( &self, id: impl std::fmt::Display, options: &ServiceIdentitiesGetOptions, ) ->Result<ServiceIdentityResponse>
Get a service identity
Returns a service identity after applying READ_SERVICE_IDENTITY authority. includeDeleted permits an authorized caller to inspect a permanent tombstone; it does not grant additional authority.
Errors include local validation, HTTP failures, and malformed responses.
HTTP: GET /v1/service-identities/{id}
list
pub async fn list( &self, options: &ServiceIdentitiesListOptions, ) ->Result<ListServiceIdentitiesResponse>
List service identities
Requires LIST_SERVICE_IDENTITY on the GoodMem instance and READ_SERVICE_IDENTITY on each returned row. Owner and label filters, lifecycle filtering, authorization, and keyset pagination execute in PostgreSQL.
LABEL FILTERS: Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).
Errors include local validation, HTTP failures, and malformed responses.
HTTP: GET /v1/service-identities
list_pages
pub fn list_pages( &self, options: &ServiceIdentitiesListOptions, ) ->Result<EventStream<ListServiceIdentitiesResponse>>
Lazily fetch pages for service_identities.list. Drop the stream to cancel.
Requires LIST_SERVICE_IDENTITY on the GoodMem instance and READ_SERVICE_IDENTITY on each returned row. Owner and label filters, lifecycle filtering, authorization, and keyset pagination execute in PostgreSQL.
LABEL FILTERS: Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).
HTTP: GET /v1/service-identities
transfer_ownership
pub async fn transfer_ownership( &self, id: impl std::fmt::Display, body: &TransferOwnershipRequest, ) ->Result<TransferServiceIdentityOwnershipResponse>
Transfer service-identity ownership
Transfers administrative ownership to another active principal. A service identity cannot own itself. The service identity's subject, immutable creator, credentials, grants, and roles are unchanged.
Errors include local validation, HTTP failures, and malformed responses.
HTTP: POST /v1/service-identities/{id}:transferOwnership
update
pub async fn update( &self, id: impl std::fmt::Display, body: &UpdateServiceIdentityRequest, ) ->Result<ServiceIdentityResponse>
Update a service identity
Updates only fields present in the request. Empty description clears that optional field. Ownership changes use the dedicated transfer endpoint.
Errors include local validation, HTTP failures, and malformed responses.
HTTP: PUT /v1/service-identities/{id}
Types
CreateServiceIdentityRequestListServiceIdentitiesResponseServiceIdentitiesGetOptionsServiceIdentitiesListOptionsServiceIdentityResponseTransferOwnershipRequestTransferServiceIdentityOwnershipResponseUpdateServiceIdentityRequest
Trait implementations
Clone(derived)Copy(derived)Debug(derived)