userver: ugrpc::ResourceInfo Struct Reference
Loading...
Searching...
No Matches
ugrpc::ResourceInfo Struct Reference

#include <userver/ugrpc/rich_status.hpp>

Detailed Description

Provides information about a resource that is related to the error.

See also
https:///github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto
ugrpc::RichStatus

Use this detail to describe a resource that caused the error or is affected by the error. Commonly used with NOT_FOUND, ALREADY_EXISTS, or PERMISSION_DENIED status codes.

Example usage:

grpc::StatusCode::NOT_FOUND,
"Resource not found",
"storage.bucket",
"projects/my-project/buckets/my-bucket",
"user:alice@example.com",
"Private user bucket",
},
};

Definition at line 293 of file rich_status.hpp.

Public Member Functions

google::rpc::ResourceInfo ToGoogleErrorDetail () const &
 
google::rpc::ResourceInfo ToGoogleErrorDetail () &&
 

Static Public Member Functions

static std::optional< ResourceInfoTryUnpack (const google::protobuf::Any &any)
 

Public Attributes

std::string resource_type
 The type of resource (e.g., "storage.bucket", "compute.instance").
 
std::string resource_name
 The name/identifier of the resource.
 
std::string owner
 The owner of the resource.
 
std::string description
 The description of the error that is encountered when accessing this resource.
 

Member Data Documentation

◆ description

std::string ugrpc::ResourceInfo::description

The description of the error that is encountered when accessing this resource.

Definition at line 304 of file rich_status.hpp.

◆ owner

std::string ugrpc::ResourceInfo::owner

The owner of the resource.

Definition at line 301 of file rich_status.hpp.

◆ resource_name

std::string ugrpc::ResourceInfo::resource_name

The name/identifier of the resource.

Definition at line 298 of file rich_status.hpp.

◆ resource_type

std::string ugrpc::ResourceInfo::resource_type

The type of resource (e.g., "storage.bucket", "compute.instance").

Definition at line 295 of file rich_status.hpp.


The documentation for this struct was generated from the following file: