pub struct StrainsService { /* private fields */ }Implementations§
Source§impl StrainsService
impl StrainsService
pub fn new(client: MetrcClient, rate_limiter: Arc<MetrcRateLimiter>) -> Self
Sourcepub async fn create_strains(
&self,
license_number: Option<String>,
body: Option<Vec<CreateStrainsRequestItem>>,
) -> Result<Option<WriteResponse>, Box<dyn Error + Send + Sync>>
pub async fn create_strains( &self, license_number: Option<String>, body: Option<Vec<CreateStrainsRequestItem>>, ) -> Result<Option<WriteResponse>, Box<dyn Error + Send + Sync>>
POST CreateStrains Creates new strain records for a specified Facility. Permissions Required:
- Manage Strains Parameters:
- body (Option<&Value>): Request body
- license_number (Option
): Filter by licenseNumber
Sourcepub async fn delete_strains_by_id(
&self,
id: &str,
license_number: Option<String>,
body: Option<&Value>,
) -> Result<Option<Value>, Box<dyn Error + Send + Sync>>
pub async fn delete_strains_by_id( &self, id: &str, license_number: Option<String>, body: Option<&Value>, ) -> Result<Option<Value>, Box<dyn Error + Send + Sync>>
DELETE DeleteStrainsById Archives an existing strain record for a Facility Permissions Required:
- Manage Strains Parameters:
- id (str): Path parameter id
- license_number (Option
): Filter by licenseNumber
Sourcepub async fn get_active_strains(
&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<Strain>>, Box<dyn Error + Send + Sync>>
pub async fn get_active_strains( &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<Strain>>, Box<dyn Error + Send + Sync>>
GET GetActiveStrains Retrieves a list of active strains for the current Facility, optionally filtered by last modified date range. Permissions Required:
- Manage Strains 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_inactive_strains(
&self,
license_number: Option<String>,
page_number: Option<String>,
page_size: Option<String>,
body: Option<&Value>,
) -> Result<Option<PaginatedResponse<Strain>>, Box<dyn Error + Send + Sync>>
pub async fn get_inactive_strains( &self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>, ) -> Result<Option<PaginatedResponse<Strain>>, Box<dyn Error + Send + Sync>>
GET GetInactiveStrains Retrieves a list of inactive strains for the current Facility, optionally filtered by last modified date range. Permissions Required:
- Manage Strains Parameters:
- license_number (Option
): Filter by licenseNumber - page_number (Option
): Filter by pageNumber - page_size (Option
): Filter by pageSize
Sourcepub async fn get_strains_by_id(
&self,
id: &str,
license_number: Option<String>,
body: Option<&Value>,
) -> Result<Option<Strain>, Box<dyn Error + Send + Sync>>
pub async fn get_strains_by_id( &self, id: &str, license_number: Option<String>, body: Option<&Value>, ) -> Result<Option<Strain>, Box<dyn Error + Send + Sync>>
GET GetStrainsById Retrieves a Strain record by its Id, with an optional license number. Permissions Required:
- Manage Strains Parameters:
- id (str): Path parameter id
- license_number (Option
): Filter by licenseNumber
Sourcepub async fn update_strains(
&self,
license_number: Option<String>,
body: Option<Vec<UpdateStrainsRequestItem>>,
) -> Result<Option<WriteResponse>, Box<dyn Error + Send + Sync>>
pub async fn update_strains( &self, license_number: Option<String>, body: Option<Vec<UpdateStrainsRequestItem>>, ) -> Result<Option<WriteResponse>, Box<dyn Error + Send + Sync>>
PUT UpdateStrains Updates existing strain records for a specified Facility. Permissions Required:
- Manage Strains Parameters:
- body (Option<&Value>): Request body
- license_number (Option
): Filter by licenseNumber
Auto Trait Implementations§
impl Freeze for StrainsService
impl !RefUnwindSafe for StrainsService
impl Send for StrainsService
impl Sync for StrainsService
impl Unpin for StrainsService
impl UnsafeUnpin for StrainsService
impl !UnwindSafe for StrainsService
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
Mutably borrows from an owned value. Read more