mirror of https://github.com/smithy-lang/smithy-rs
Add getter methods to OperationExtension (#1466)
* Add `OperationExtension::namespace` and `OperationExtension::operation_name`.
This commit is contained in:
parent
5a5aa2f3d6
commit
8dd03fdf7f
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue