Module mz_cloud_api::client::cloud_provider

source ·
Expand description

This module implements Materialize cloud API sync endpoint to list all the availables cloud providers and regions, represented by CloudProvider. As utilities, the module implements the enum CloudProviderRegion. It is useful to validate and compare external input (e.g. user input) with the results from the cloud API represented by CloudProvider.

Example:

// List all the available providers
let cloud_providers = client.list_cloud_regions().await?;

// Search the cloud provider
let user_input = "aws/us-east-1";
let cloud_provider_region_selected: CloudProviderRegion = CloudProviderRegion::from_str(user_input)?;
let cloud_provider: CloudProvider = cloud_providers
   .iter()
   .find(|cp| cp.as_cloud_provider_region().unwrap() == cloud_provider_region_selected)
   .unwrap()
   .to_owned();

Structs§

  • Holds all the information related to a cloud provider and a particular region.

Enums§

  • Represents a cloud provider and a region. Useful to transform a user input selecting a cloud provider region to an enum and vice-versa.