pub struct MarkingServiceClient<T> { /* private fields */ }
Expand description
This service manages Markings, which are a mechanism to restrict access to data sources.
Implementations§
Source§impl<T> MarkingServiceClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> MarkingServiceClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> MarkingServiceClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<Body>, Response = Response<<T as GrpcService<Body>>::ResponseBody>>,
<T as Service<Request<Body>>>::Error: Into<StdError> + Send + Sync,
Sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
Sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
Sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
Sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
Sourcepub async fn create_marking(
&mut self,
request: impl IntoRequest<CreateMarkingRequest>,
) -> Result<Response<CreateMarkingResponse>, Status>
pub async fn create_marking( &mut self, request: impl IntoRequest<CreateMarkingRequest>, ) -> Result<Response<CreateMarkingResponse>, Status>
Creates a marking. Throws HTTP 409 / gRPC 6 if a marking with the same ID already exists. Throws HTTP 403 / gRPC 7 if the user does not have permission to create a marking. Throws HTTP 403 / gRPC 7 if the user does not have permission to read some of the specified groups.
Sourcepub async fn get_marking(
&mut self,
request: impl IntoRequest<GetMarkingRequest>,
) -> Result<Response<GetMarkingResponse>, Status>
pub async fn get_marking( &mut self, request: impl IntoRequest<GetMarkingRequest>, ) -> Result<Response<GetMarkingResponse>, Status>
Gets a marking by its RID. Throws HTTP 403 / gRPC 7 if the user does not have permission to read the marking. Throws HTTP 403 / gRPC 5 if the marking is not found.
Sourcepub async fn get_marking_by_id(
&mut self,
request: impl IntoRequest<GetMarkingByIdRequest>,
) -> Result<Response<GetMarkingByIdResponse>, Status>
pub async fn get_marking_by_id( &mut self, request: impl IntoRequest<GetMarkingByIdRequest>, ) -> Result<Response<GetMarkingByIdResponse>, Status>
Gets a marking by its ID, a human-readable identifier unique within the org. Throws HTTP 403 / gRPC 7 if the user does not have permission to read the marking. Throws HTTP 403 / gRPC 5 if the marking is not found.
Sourcepub async fn batch_get_markings(
&mut self,
request: impl IntoRequest<BatchGetMarkingsRequest>,
) -> Result<Response<BatchGetMarkingsResponse>, Status>
pub async fn batch_get_markings( &mut self, request: impl IntoRequest<BatchGetMarkingsRequest>, ) -> Result<Response<BatchGetMarkingsResponse>, Status>
Gets multiple markings by RID. If a marking is not found or the user doesn’t have permission to read it, it will not be included in the response.
Sourcepub async fn batch_get_marking_metadata(
&mut self,
request: impl IntoRequest<BatchGetMarkingMetadataRequest>,
) -> Result<Response<BatchGetMarkingMetadataResponse>, Status>
pub async fn batch_get_marking_metadata( &mut self, request: impl IntoRequest<BatchGetMarkingMetadataRequest>, ) -> Result<Response<BatchGetMarkingMetadataResponse>, Status>
Gets metadata for multiple markings by RID. Metadata does not include the authorized groups. If a marking is not found or the user doesn’t have permission to read it, it will not be included in the response.
Gets the authorized Groups for each of a set of Markings. Markings that are not found or for which the user does not have permission to read will be filtered from the response. Groups for which the user does not have permission to read will be filtered from the response.
Sourcepub async fn search_markings(
&mut self,
request: impl IntoRequest<SearchMarkingsRequest>,
) -> Result<Response<SearchMarkingsResponse>, Status>
pub async fn search_markings( &mut self, request: impl IntoRequest<SearchMarkingsRequest>, ) -> Result<Response<SearchMarkingsResponse>, Status>
Search Markings, returning paged results. Throws HTTP 400 / gRPC 3 if the query is incorrectly formed.
Sourcepub async fn update_marking(
&mut self,
request: impl IntoRequest<UpdateMarkingRequest>,
) -> Result<Response<UpdateMarkingResponse>, Status>
pub async fn update_marking( &mut self, request: impl IntoRequest<UpdateMarkingRequest>, ) -> Result<Response<UpdateMarkingResponse>, Status>
Updates a marking. Throws HTTP 403 / gRPC 7 if the user does not have permission to update the marking. Throws HTTP 403 / gRPC 7 if the user does not have permission to read any of the specified groups. Throws HTTP 403 / gRPC 5 if the marking is not found. Throws HTTP 409 / gRPC 6 if trying to update the ID of a marking to an ID that already exists. Throws HTTP 400 / gRPC 3 if trying to update an archived marking.
Sourcepub async fn archive_markings(
&mut self,
request: impl IntoRequest<ArchiveMarkingsRequest>,
) -> Result<Response<ArchiveMarkingsResponse>, Status>
pub async fn archive_markings( &mut self, request: impl IntoRequest<ArchiveMarkingsRequest>, ) -> Result<Response<ArchiveMarkingsResponse>, Status>
Archives markings. Archiving a marking is an idempotent operation that prevents further changes
or applications of the marking.
Archived markings will not appear in search but can be retrieved by get
endpoints.
Throws HTTP 403 / gRPC 7 if the user does not have permission to archive one or more of the markings
or if any of the markings are not found.
Throws HTTP 400 / gRPC 3 if the archived marking is currently applied to one or more resources.
TODO(MGMT-489): this will throw 403 if any of the Markings don’t exist, but we should throw 404 instead.
Sourcepub async fn unarchive_markings(
&mut self,
request: impl IntoRequest<UnarchiveMarkingsRequest>,
) -> Result<Response<UnarchiveMarkingsResponse>, Status>
pub async fn unarchive_markings( &mut self, request: impl IntoRequest<UnarchiveMarkingsRequest>, ) -> Result<Response<UnarchiveMarkingsResponse>, Status>
Unarchives markings. Restores ability to apply and modify marking. Throws HTTP 403 / gRPC 7 if the user does not have permission to unarchive one or more of the markings or if any of the markings are not found. TODO(MGMT-489): this will throw 403 if any of the Markings don’t exist, but we should throw 404 instead.
Sourcepub async fn update_markings_on_resource(
&mut self,
request: impl IntoRequest<UpdateMarkingsOnResourceRequest>,
) -> Result<Response<UpdateMarkingsOnResourceResponse>, Status>
pub async fn update_markings_on_resource( &mut self, request: impl IntoRequest<UpdateMarkingsOnResourceRequest>, ) -> Result<Response<UpdateMarkingsOnResourceResponse>, Status>
Update the markings that are applied on a resource. Supports applying and removing markings at once.
This endpoint can be used to atomically replace the markings on a resource, or bulk apply/remove markings.
This operation is idempotent and will not throw an error if the marking is already applied/removed on the resource.
If a resource marking pair is present in both markings_to_apply
and markings_to_remove
, this will throw.
Throws HTTP 403 / gRPC 7 if the user does not have permission to change the markings on the resource.
Throws HTTP 400 / gRPC 3 if trying to apply an archived marking.
Sourcepub async fn get_resources_for_marking(
&mut self,
request: impl IntoRequest<GetResourcesForMarkingRequest>,
) -> Result<Response<GetResourcesForMarkingResponse>, Status>
pub async fn get_resources_for_marking( &mut self, request: impl IntoRequest<GetResourcesForMarkingRequest>, ) -> Result<Response<GetResourcesForMarkingResponse>, Status>
Gets the resources that a Marking is applied to. This endpoint is paginated. Any unauthorized resources will be filtered from the response. Throws HTTP 403 / gRPC 7 if the user does not have permission to read the marking.
Sourcepub async fn get_markings_for_resources(
&mut self,
request: impl IntoRequest<GetMarkingsForResourcesRequest>,
) -> Result<Response<GetMarkingsForResourcesResponse>, Status>
pub async fn get_markings_for_resources( &mut self, request: impl IntoRequest<GetMarkingsForResourcesRequest>, ) -> Result<Response<GetMarkingsForResourcesResponse>, Status>
Gets the requested resources and the markings applied to them. Since the number of markings applied to a resource is typically small, this endpoint will return all markings for each resource. Any unauthorized resources or markings will be filtered from the response.
Trait Implementations§
Source§impl<T: Clone> Clone for MarkingServiceClient<T>
impl<T: Clone> Clone for MarkingServiceClient<T>
Source§fn clone(&self) -> MarkingServiceClient<T>
fn clone(&self) -> MarkingServiceClient<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> !Freeze for MarkingServiceClient<T>
impl<T> RefUnwindSafe for MarkingServiceClient<T>where
T: RefUnwindSafe,
impl<T> Send for MarkingServiceClient<T>where
T: Send,
impl<T> Sync for MarkingServiceClient<T>where
T: Sync,
impl<T> Unpin for MarkingServiceClient<T>where
T: Unpin,
impl<T> UnwindSafe for MarkingServiceClient<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request