use crate::client::Client;
#[allow(unused_imports)]
use crate::enums::*;
use crate::error::Error;
#[allow(unused_imports)]
use crate::models::*;
use serde::Serialize;
pub struct PipesProviderApi<'a> {
pub(crate) client: &'a Client,
}
#[derive(Debug, Clone, Serialize)]
pub struct UpdateOrganizationDataIntegrationConfigurationParams {
#[serde(skip)]
pub body: ConfigureDataIntegrationBody,
}
impl UpdateOrganizationDataIntegrationConfigurationParams {
#[allow(deprecated)]
pub fn new(body: ConfigureDataIntegrationBody) -> Self {
Self { body }
}
}
impl<'a> PipesProviderApi<'a> {
pub async fn list_organization_data_integration_configurations(
&self,
organization_id: &str,
) -> Result<DataIntegrationConfigurationListResponse, Error> {
self.list_organization_data_integration_configurations_with_options(organization_id, None)
.await
}
pub async fn list_organization_data_integration_configurations_with_options(
&self,
organization_id: &str,
options: Option<&crate::RequestOptions>,
) -> Result<DataIntegrationConfigurationListResponse, Error> {
let organization_id = crate::client::path_segment(organization_id);
let path = format!("/organizations/{organization_id}/data_integration_configurations");
let method = http::Method::GET;
self.client
.request_with_query_opts(method, &path, &(), options)
.await
}
pub async fn update_organization_data_integration_configuration(
&self,
organization_id: &str,
slug: &str,
params: UpdateOrganizationDataIntegrationConfigurationParams,
) -> Result<DataIntegrationConfigurationResponse, Error> {
self.update_organization_data_integration_configuration_with_options(
organization_id,
slug,
params,
None,
)
.await
}
pub async fn update_organization_data_integration_configuration_with_options(
&self,
organization_id: &str,
slug: &str,
params: UpdateOrganizationDataIntegrationConfigurationParams,
options: Option<&crate::RequestOptions>,
) -> Result<DataIntegrationConfigurationResponse, Error> {
let organization_id = crate::client::path_segment(organization_id);
let slug = crate::client::path_segment(slug);
let path =
format!("/organizations/{organization_id}/data_integration_configurations/{slug}");
let method = http::Method::PUT;
self.client
.request_with_body_opts(method, &path, ¶ms, Some(¶ms.body), options)
.await
}
}