pub struct ItemsService { /* private fields */ }Implementations§
Source§impl ItemsService
impl ItemsService
pub fn new(client: MetrcClient, rate_limiter: Arc<MetrcRateLimiter>) -> Self
Sourcepub async fn create_items_brand(
&self,
license_number: Option<String>,
body: Option<Vec<CreateBrandRequestItem>>,
) -> Result<Option<WriteResponse>, Box<dyn Error + Send + Sync>>
pub async fn create_items_brand( &self, license_number: Option<String>, body: Option<Vec<CreateBrandRequestItem>>, ) -> Result<Option<WriteResponse>, Box<dyn Error + Send + Sync>>
POST CreateBrand Creates one or more new item brands for the specified Facility identified by the License Number. Permissions Required:
- Manage Items Parameters:
- body (Option<&Value>): Request body
- license_number (Option
): Filter by licenseNumber
Sourcepub async fn create_items_file(
&self,
license_number: Option<String>,
body: Option<Vec<CreateFileRequestItem>>,
) -> Result<Option<WriteResponse>, Box<dyn Error + Send + Sync>>
pub async fn create_items_file( &self, license_number: Option<String>, body: Option<Vec<CreateFileRequestItem>>, ) -> Result<Option<WriteResponse>, Box<dyn Error + Send + Sync>>
POST CreateFile Uploads one or more image or PDF files for products, labels, packaging, or documents at the specified Facility. Permissions Required:
- Manage Items Parameters:
- body (Option<&Value>): Request body
- license_number (Option
): Filter by licenseNumber
Sourcepub async fn create_items(
&self,
license_number: Option<String>,
body: Option<Vec<CreateItemsRequestItem>>,
) -> Result<Option<WriteResponse>, Box<dyn Error + Send + Sync>>
pub async fn create_items( &self, license_number: Option<String>, body: Option<Vec<CreateItemsRequestItem>>, ) -> Result<Option<WriteResponse>, Box<dyn Error + Send + Sync>>
POST CreateItems Permissions Required:
- Manage Items Parameters:
- body (Option<&Value>): Request body
- license_number (Option
): Filter by licenseNumber
Sourcepub async fn create_items_photo(
&self,
license_number: Option<String>,
body: Option<Vec<CreatePhotoRequestItem>>,
) -> Result<Option<WriteResponse>, Box<dyn Error + Send + Sync>>
pub async fn create_items_photo( &self, license_number: Option<String>, body: Option<Vec<CreatePhotoRequestItem>>, ) -> Result<Option<WriteResponse>, Box<dyn Error + Send + Sync>>
POST CreatePhoto This endpoint allows only BMP, GIF, JPG, and PNG files and uploaded files can be no more than 5 MB in size. Permissions Required:
- Manage Items Parameters:
- body (Option<&Value>): Request body
- license_number (Option
): Filter by licenseNumber
Sourcepub async fn delete_items_brand_by_id(
&self,
id: &str,
license_number: Option<String>,
body: Option<&Value>,
) -> Result<Option<Value>, Box<dyn Error + Send + Sync>>
pub async fn delete_items_brand_by_id( &self, id: &str, license_number: Option<String>, body: Option<&Value>, ) -> Result<Option<Value>, Box<dyn Error + Send + Sync>>
DELETE DeleteBrandById Archives the specified Item Brand by Id for the given Facility License Number. Permissions Required:
- Manage Items Parameters:
- id (str): Path parameter id
- license_number (Option
): Filter by licenseNumber
Sourcepub async fn delete_items_by_id(
&self,
id: &str,
license_number: Option<String>,
body: Option<&Value>,
) -> Result<Option<Value>, Box<dyn Error + Send + Sync>>
pub async fn delete_items_by_id( &self, id: &str, license_number: Option<String>, body: Option<&Value>, ) -> Result<Option<Value>, Box<dyn Error + Send + Sync>>
DELETE DeleteItemsById Archives the specified Product by Id for the given Facility License Number. Permissions Required:
- Manage Items Parameters:
- id (str): Path parameter id
- license_number (Option
): Filter by licenseNumber
Sourcepub async fn get_active_items(
&self,
last_modified_end: Option<String>,
last_modified_start: Option<String>,
license_number: Option<String>,
page_number: Option<String>,
page_size: Option<String>,
body: Option<&Value>,
) -> Result<Option<PaginatedResponse<Item>>, Box<dyn Error + Send + Sync>>
pub async fn get_active_items( &self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>, ) -> Result<Option<PaginatedResponse<Item>>, Box<dyn Error + Send + Sync>>
GET GetActiveItems Returns a list of active items for the specified Facility. Permissions Required:
- Manage Items Parameters:
- last_modified_end (Option
): Filter by lastModifiedEnd - last_modified_start (Option
): Filter by lastModifiedStart - license_number (Option
): Filter by licenseNumber - page_number (Option
): Filter by pageNumber - page_size (Option
): Filter by pageSize
Sourcepub async fn get_items_brands(
&self,
license_number: Option<String>,
page_number: Option<String>,
page_size: Option<String>,
body: Option<&Value>,
) -> Result<Option<PaginatedResponse<Brand>>, Box<dyn Error + Send + Sync>>
pub async fn get_items_brands( &self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>, ) -> Result<Option<PaginatedResponse<Brand>>, Box<dyn Error + Send + Sync>>
GET GetBrands Retrieves a list of active item brands for the specified Facility. Permissions Required:
- Manage Items Parameters:
- license_number (Option
): Filter by licenseNumber - page_number (Option
): Filter by pageNumber - page_size (Option
): Filter by pageSize
Sourcepub async fn get_items_categories(
&self,
license_number: Option<String>,
page_number: Option<String>,
page_size: Option<String>,
body: Option<&Value>,
) -> Result<Option<PaginatedResponse<Category>>, Box<dyn Error + Send + Sync>>
pub async fn get_items_categories( &self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>, ) -> Result<Option<PaginatedResponse<Category>>, Box<dyn Error + Send + Sync>>
GET GetCategories Retrieves a list of item categories. Parameters:
- license_number (Option
): Filter by licenseNumber - page_number (Option
): Filter by pageNumber - page_size (Option
): Filter by pageSize
Sourcepub async fn get_items_file_by_id(
&self,
id: &str,
license_number: Option<String>,
body: Option<&Value>,
) -> Result<Option<File>, Box<dyn Error + Send + Sync>>
pub async fn get_items_file_by_id( &self, id: &str, license_number: Option<String>, body: Option<&Value>, ) -> Result<Option<File>, Box<dyn Error + Send + Sync>>
GET GetFileById Retrieves a file by its Id for the specified Facility. Permissions Required:
- Manage Items Parameters:
- id (str): Path parameter id
- license_number (Option
): Filter by licenseNumber
Sourcepub async fn get_inactive_items(
&self,
license_number: Option<String>,
page_number: Option<String>,
page_size: Option<String>,
body: Option<&Value>,
) -> Result<Option<PaginatedResponse<Item>>, Box<dyn Error + Send + Sync>>
pub async fn get_inactive_items( &self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>, ) -> Result<Option<PaginatedResponse<Item>>, Box<dyn Error + Send + Sync>>
GET GetInactiveItems Retrieves a list of inactive items for the specified Facility. Permissions Required:
- Manage Items Parameters:
- license_number (Option
): Filter by licenseNumber - page_number (Option
): Filter by pageNumber - page_size (Option
): Filter by pageSize
Sourcepub async fn get_items_by_id(
&self,
id: &str,
license_number: Option<String>,
body: Option<&Value>,
) -> Result<Option<Item>, Box<dyn Error + Send + Sync>>
pub async fn get_items_by_id( &self, id: &str, license_number: Option<String>, body: Option<&Value>, ) -> Result<Option<Item>, Box<dyn Error + Send + Sync>>
GET GetItemsById Retrieves detailed information about a specific Item by Id. Permissions Required:
- Manage Items Parameters:
- id (str): Path parameter id
- license_number (Option
): Filter by licenseNumber
Sourcepub async fn get_items_photo_by_id(
&self,
id: &str,
license_number: Option<String>,
body: Option<&Value>,
) -> Result<Option<Photo>, Box<dyn Error + Send + Sync>>
pub async fn get_items_photo_by_id( &self, id: &str, license_number: Option<String>, body: Option<&Value>, ) -> Result<Option<Photo>, Box<dyn Error + Send + Sync>>
GET GetPhotoById Retrieves an image by its Id for the specified Facility. Permissions Required:
- Manage Items Parameters:
- id (str): Path parameter id
- license_number (Option
): Filter by licenseNumber
Sourcepub async fn update_items_brand(
&self,
license_number: Option<String>,
body: Option<Vec<UpdateBrandRequestItem>>,
) -> Result<Option<WriteResponse>, Box<dyn Error + Send + Sync>>
pub async fn update_items_brand( &self, license_number: Option<String>, body: Option<Vec<UpdateBrandRequestItem>>, ) -> Result<Option<WriteResponse>, Box<dyn Error + Send + Sync>>
PUT UpdateBrand Updates one or more existing item brands for the specified Facility. Permissions Required:
- Manage Items Parameters:
- body (Option<&Value>): Request body
- license_number (Option
): Filter by licenseNumber
Sourcepub async fn update_items(
&self,
license_number: Option<String>,
body: Option<Vec<UpdateItemsRequestItem>>,
) -> Result<Option<WriteResponse>, Box<dyn Error + Send + Sync>>
pub async fn update_items( &self, license_number: Option<String>, body: Option<Vec<UpdateItemsRequestItem>>, ) -> Result<Option<WriteResponse>, Box<dyn Error + Send + Sync>>
PUT UpdateItems Updates one or more existing products for the specified Facility. Permissions Required:
- Manage Items Parameters:
- body (Option<&Value>): Request body
- license_number (Option
): Filter by licenseNumber