Add getter methods to OperationExtension (#1466)

* Add `OperationExtension::namespace` and `OperationExtension::operation_name`.
This commit is contained in:
Harry Barber 2022-06-29 12:38:07 +01:00 committed by GitHub
parent 5a5aa2f3d6
commit 8dd03fdf7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -73,6 +73,16 @@ impl OperationExtension {
}
}
/// Returns the Smithy model namespace.
pub fn namespace(&self) -> &'static str {
self.namespace
}
/// Returns the Smithy operation name.
pub fn operation_name(&self) -> &'static str {
self.operation_name
}
/// Returns the current operation formatted as `<namespace>#<operation_name>`.
pub fn operation(&self) -> String {
format!("{}#{}", self.namespace, self.operation_name)