superposition_sdk 0.100.2

Rust SDK to work with Superposition
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[derive(Debug)]
                pub(crate) struct Handle {
                    pub(crate) conf: crate::Config,
                    #[allow(dead_code)] // unused when a service does not provide any operations
                    pub(crate) runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
                }

                
/// 
/// An ergonomic client for Superposition.
/// 
/// This client allows ergonomic access to Superposition.
/// Each method corresponds to an API defined in the service's Smithy model,
/// and the request and response shapes are auto-generated from that same model.
/// 
/// Client for calling Superposition.
/// 
/// ## Constructing a `Client`
/// 
/// A `Client` requires a config in order to be constructed. With the default set of Cargo features,
/// this config will only require an endpoint to produce a functioning client. However, some Smithy
/// features will require additional configuration. For example, `@auth` requires some kind of identity
/// or identity resolver to be configured. The config is used to customize various aspects of the client,
/// such as:
/// 
///   - [The underlying HTTP client](crate::config::Builder::http_client)
///   - [Retries](crate::config::Builder::retry_config)
///   - [Timeouts](crate::config::Builder::timeout_config)
///   - [... and more](crate::config::Builder)
/// 
/// Below is a minimal example of how to create a client:
/// 
/// ```rust,no_run
/// let config = superposition_sdk::Config::builder()
///     .endpoint_url("http://localhost:1234")
///     .build();
/// let client = superposition_sdk::Client::from_conf(config);
/// ```
/// 
/// _Note:_ Client construction is expensive due to connection thread pool initialization, and should be done
/// once at application start-up. Cloning a client is cheap (it's just an [`Arc`](std::sync::Arc) under the hood),
/// so creating it once at start-up and cloning it around the application as needed is recommended.
/// # Using the `Client`
/// 
/// A client has a function for every operation that can be performed by the service.
/// For example, the [`AddMembersToGroup`](crate::operation::add_members_to_group) operation has
/// a [`Client::add_members_to_group`], function which returns a builder for that operation.
/// The fluent builder ultimately has a `send()` function that returns an async future that
/// returns a result, as illustrated below:
/// 
/// ```rust,ignore
/// let result = client.add_members_to_group()
///     .workspace_id("example")
///     .send()
///     .await;
/// ```
/// 
/// The underlying HTTP requests that get made by this can be modified with the `customize_operation`
/// function on the fluent builder. See the [`customize`](crate::client::customize) module for more
/// information.
                #[derive(::std::clone::Clone, ::std::fmt::Debug)]
                pub struct Client {
                    handle: ::std::sync::Arc<Handle>,
                }

                impl Client {
                    /// Creates a new client from the service [`Config`](crate::Config).
                    ///
                    /// # Panics
                    ///
                    /// This method will panic in the following cases:
                    ///
                    /// - Retries or timeouts are enabled without a `sleep_impl` configured.
                    /// - Identity caching is enabled without a `sleep_impl` and `time_source` configured.
                    /// - No `behavior_version` is provided.
                    ///
                    /// The panic message for each of these will have instructions on how to resolve them.
                    #[track_caller]
                    pub fn from_conf(conf: crate::Config) -> Self {
                        let handle = Handle {
                            conf: conf.clone(),
                            runtime_plugins: crate::config::base_client_runtime_plugins(conf),
                        };
                        if let Err(err) = Self::validate_config(&handle) {
                            panic!("Invalid client configuration: {err}");
                        }
                        Self {
                            handle: ::std::sync::Arc::new(handle)
                        }
                    }

                    /// Returns the client's configuration.
                    pub fn config(&self) -> &crate::Config {
                        &self.handle.conf
                    }

                    fn validate_config(handle: &Handle) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
                        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
                        handle.runtime_plugins
                            .apply_client_configuration(&mut cfg)?
                            .validate_base_client_config(&cfg)?;
                        Ok(())
                    }
                }

mod add_members_to_group;

mod applicable_variants;

mod bulk_operation;

mod conclude_experiment;

mod create_context;

mod create_default_config;

mod create_dimension;

mod create_experiment;

mod create_experiment_group;

mod create_function;

mod create_organisation;

mod create_secret;

mod create_type_templates;

mod create_variable;

mod create_webhook;

mod create_workspace;

/// Operation customization and supporting types.
/// 
/// The underlying HTTP requests made during an operation can be customized
/// by calling the `customize()` method on the builder returned from a client
/// operation call. For example, this can be used to add an additional HTTP header:
/// 
/// ```ignore
/// # async fn wrapper() -> ::std::result::Result<(), superposition_sdk::Error> {
/// # let client: superposition_sdk::Client = unimplemented!();
/// use ::http::header::{HeaderName, HeaderValue};
/// 
/// let result = client.add_members_to_group()
///     .customize()
///     .mutate_request(|req| {
///         // Add `x-example-header` with value
///         req.headers_mut()
///             .insert(
///                 HeaderName::from_static("x-example-header"),
///                 HeaderValue::from_static("1"),
///             );
///     })
///     .send()
///     .await;
/// # }
/// ```
pub mod customize;

mod delete_context;

mod delete_default_config;

mod delete_dimension;

mod delete_experiment_group;

mod delete_function;

mod delete_secret;

mod delete_type_templates;

mod delete_variable;

mod delete_webhook;

mod discard_experiment;

mod get_config;

mod get_config_fast;

mod get_config_json;

mod get_config_toml;

mod get_context;

mod get_context_from_condition;

mod get_default_config;

mod get_dimension;

mod get_experiment;

mod get_experiment_group;

mod get_function;

mod get_organisation;

mod get_resolved_config;

mod get_resolved_config_with_identifier;

mod get_secret;

mod get_type_template;

mod get_type_templates_list;

mod get_variable;

mod get_version;

mod get_webhook;

mod get_webhook_by_event;

mod get_workspace;

mod list_audit_logs;

mod list_contexts;

mod list_default_configs;

mod list_dimensions;

mod list_experiment;

mod list_experiment_groups;

mod list_function;

mod list_organisation;

mod list_secrets;

mod list_variables;

mod list_versions;

mod list_webhook;

mod list_workspace;

mod migrate_workspace_schema;

mod move_context;

mod pause_experiment;

mod publish;

mod ramp_experiment;

mod remove_members_from_group;

mod resume_experiment;

mod rotate_master_encryption_key;

mod rotate_workspace_encryption_key;

mod test;

mod update_default_config;

mod update_dimension;

mod update_experiment_group;

mod update_function;

mod update_organisation;

mod update_override;

mod update_overrides_experiment;

mod update_secret;

mod update_type_templates;

mod update_variable;

mod update_webhook;

mod update_workspace;

mod validate_context;

mod weight_recompute;