Upgrade an organization's plan. The exact plan transition is determined server-side based on the organization's current plan and eligibility.
(name: &str)
| 131 | /// The exact plan transition is determined server-side based on the |
| 132 | /// organization's current plan and eligibility. |
| 133 | fn slugify(name: &str) -> String { |
| 134 | let mut slug = String::new(); |
| 135 | let mut last_was_dash = false; |
| 136 | |
| 137 | for ch in name.chars().flat_map(char::to_lowercase) { |
| 138 | if ch.is_ascii_alphanumeric() { |
| 139 | slug.push(ch); |
| 140 | last_was_dash = false; |
| 141 | } else if !last_was_dash && !slug.is_empty() { |
| 142 | slug.push('-'); |
| 143 | last_was_dash = true; |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | while slug.ends_with('-') { |
| 148 | slug.pop(); |
| 149 | } |
| 150 | |
| 151 | slug |
| 152 | } |
| 153 | |
| 154 | pub async fn upgrade_org(client: &StorageClient, slug: &str) -> TeamsResult<OrgInfo> { |
| 155 | debug!("Upgrading organization: slug={slug}"); |
no test coverage detected