pub struct OrganizationsAPI { /* private fields */ }
Expand description
Create, edit, and manage your organizations. Read more about multi-org accounts.
Implementations§
Source§impl OrganizationsAPI
impl OrganizationsAPI
pub fn new() -> Self
Sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
More examples
7async fn main() {
8 let configuration = datadog::Configuration::new();
9 let api = OrganizationsAPI::with_config(configuration);
10 let resp = api
11 .upload_idp_for_org(
12 "abc123".to_string(),
13 fs::read("./idp_metadata.xml").unwrap(),
14 )
15 .await;
16 if let Ok(value) = resp {
17 println!("{:#?}", value);
18 } else {
19 println!("{:#?}", resp.unwrap_err());
20 }
21}
9async fn main() {
10 let body = OrganizationCreateBody::new("New child org".to_string())
11 .billing(OrganizationBilling::new().type_("parent_billing".to_string()))
12 .subscription(OrganizationSubscription::new().type_("pro".to_string()));
13 let configuration = datadog::Configuration::new();
14 let api = OrganizationsAPI::with_config(configuration);
15 let resp = api.create_child_org(body).await;
16 if let Ok(value) = resp {
17 println!("{:#?}", value);
18 } else {
19 println!("{:#?}", resp.unwrap_err());
20 }
21}
15async fn main() {
16 let body = Organization::new()
17 .billing(OrganizationBilling::new().type_("parent_billing".to_string()))
18 .description("some description".to_string())
19 .name("New child org".to_string())
20 .public_id("abcdef12345".to_string())
21 .settings(
22 OrganizationSettings::new()
23 .private_widget_share(false)
24 .saml(OrganizationSettingsSaml::new().enabled(false))
25 .saml_autocreate_access_role(Some(AccessRole::READ_ONLY))
26 .saml_autocreate_users_domains(
27 OrganizationSettingsSamlAutocreateUsersDomains::new()
28 .domains(vec!["example.com".to_string()])
29 .enabled(false),
30 )
31 .saml_can_be_enabled(false)
32 .saml_idp_endpoint("https://my.saml.endpoint".to_string())
33 .saml_idp_initiated_login(
34 OrganizationSettingsSamlIdpInitiatedLogin::new().enabled(false),
35 )
36 .saml_idp_metadata_uploaded(false)
37 .saml_login_url("https://my.saml.login.url".to_string())
38 .saml_strict_mode(OrganizationSettingsSamlStrictMode::new().enabled(false)),
39 )
40 .subscription(OrganizationSubscription::new().type_("pro".to_string()))
41 .trial(false);
42 let configuration = datadog::Configuration::new();
43 let api = OrganizationsAPI::with_config(configuration);
44 let resp = api.update_org("abc123".to_string(), body).await;
45 if let Ok(value) = resp {
46 println!("{:#?}", value);
47 } else {
48 println!("{:#?}", resp.unwrap_err());
49 }
50}
pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
Sourcepub async fn create_child_org(
&self,
body: OrganizationCreateBody,
) -> Result<OrganizationCreateResponse, Error<CreateChildOrgError>>
pub async fn create_child_org( &self, body: OrganizationCreateBody, ) -> Result<OrganizationCreateResponse, Error<CreateChildOrgError>>
Create a child organization.
This endpoint requires the multi-organization account feature and must be enabled by contacting support.
Once a new child organization is created, you can interact with it
by using the org.public_id
, api_key.key
, and
application_key.hash
provided in the response.
Examples found in repository?
9async fn main() {
10 let body = OrganizationCreateBody::new("New child org".to_string())
11 .billing(OrganizationBilling::new().type_("parent_billing".to_string()))
12 .subscription(OrganizationSubscription::new().type_("pro".to_string()));
13 let configuration = datadog::Configuration::new();
14 let api = OrganizationsAPI::with_config(configuration);
15 let resp = api.create_child_org(body).await;
16 if let Ok(value) = resp {
17 println!("{:#?}", value);
18 } else {
19 println!("{:#?}", resp.unwrap_err());
20 }
21}
Sourcepub async fn create_child_org_with_http_info(
&self,
body: OrganizationCreateBody,
) -> Result<ResponseContent<OrganizationCreateResponse>, Error<CreateChildOrgError>>
pub async fn create_child_org_with_http_info( &self, body: OrganizationCreateBody, ) -> Result<ResponseContent<OrganizationCreateResponse>, Error<CreateChildOrgError>>
Create a child organization.
This endpoint requires the multi-organization account feature and must be enabled by contacting support.
Once a new child organization is created, you can interact with it
by using the org.public_id
, api_key.key
, and
application_key.hash
provided in the response.
Sourcepub async fn downgrade_org(
&self,
public_id: String,
) -> Result<OrgDowngradedResponse, Error<DowngradeOrgError>>
pub async fn downgrade_org( &self, public_id: String, ) -> Result<OrgDowngradedResponse, Error<DowngradeOrgError>>
Only available for MSP customers. Removes a child organization from the hierarchy of the master organization and places the child organization on a 30-day trial.
Sourcepub async fn downgrade_org_with_http_info(
&self,
public_id: String,
) -> Result<ResponseContent<OrgDowngradedResponse>, Error<DowngradeOrgError>>
pub async fn downgrade_org_with_http_info( &self, public_id: String, ) -> Result<ResponseContent<OrgDowngradedResponse>, Error<DowngradeOrgError>>
Only available for MSP customers. Removes a child organization from the hierarchy of the master organization and places the child organization on a 30-day trial.
Sourcepub async fn get_org(
&self,
public_id: String,
) -> Result<OrganizationResponse, Error<GetOrgError>>
pub async fn get_org( &self, public_id: String, ) -> Result<OrganizationResponse, Error<GetOrgError>>
Get organization information.
Sourcepub async fn get_org_with_http_info(
&self,
public_id: String,
) -> Result<ResponseContent<OrganizationResponse>, Error<GetOrgError>>
pub async fn get_org_with_http_info( &self, public_id: String, ) -> Result<ResponseContent<OrganizationResponse>, Error<GetOrgError>>
Get organization information.
Sourcepub async fn list_orgs(
&self,
) -> Result<OrganizationListResponse, Error<ListOrgsError>>
pub async fn list_orgs( &self, ) -> Result<OrganizationListResponse, Error<ListOrgsError>>
This endpoint returns data on your top-level organization.
Sourcepub async fn list_orgs_with_http_info(
&self,
) -> Result<ResponseContent<OrganizationListResponse>, Error<ListOrgsError>>
pub async fn list_orgs_with_http_info( &self, ) -> Result<ResponseContent<OrganizationListResponse>, Error<ListOrgsError>>
This endpoint returns data on your top-level organization.
Sourcepub async fn update_org(
&self,
public_id: String,
body: Organization,
) -> Result<OrganizationResponse, Error<UpdateOrgError>>
pub async fn update_org( &self, public_id: String, body: Organization, ) -> Result<OrganizationResponse, Error<UpdateOrgError>>
Update your organization.
Examples found in repository?
15async fn main() {
16 let body = Organization::new()
17 .billing(OrganizationBilling::new().type_("parent_billing".to_string()))
18 .description("some description".to_string())
19 .name("New child org".to_string())
20 .public_id("abcdef12345".to_string())
21 .settings(
22 OrganizationSettings::new()
23 .private_widget_share(false)
24 .saml(OrganizationSettingsSaml::new().enabled(false))
25 .saml_autocreate_access_role(Some(AccessRole::READ_ONLY))
26 .saml_autocreate_users_domains(
27 OrganizationSettingsSamlAutocreateUsersDomains::new()
28 .domains(vec!["example.com".to_string()])
29 .enabled(false),
30 )
31 .saml_can_be_enabled(false)
32 .saml_idp_endpoint("https://my.saml.endpoint".to_string())
33 .saml_idp_initiated_login(
34 OrganizationSettingsSamlIdpInitiatedLogin::new().enabled(false),
35 )
36 .saml_idp_metadata_uploaded(false)
37 .saml_login_url("https://my.saml.login.url".to_string())
38 .saml_strict_mode(OrganizationSettingsSamlStrictMode::new().enabled(false)),
39 )
40 .subscription(OrganizationSubscription::new().type_("pro".to_string()))
41 .trial(false);
42 let configuration = datadog::Configuration::new();
43 let api = OrganizationsAPI::with_config(configuration);
44 let resp = api.update_org("abc123".to_string(), body).await;
45 if let Ok(value) = resp {
46 println!("{:#?}", value);
47 } else {
48 println!("{:#?}", resp.unwrap_err());
49 }
50}
Sourcepub async fn update_org_with_http_info(
&self,
public_id: String,
body: Organization,
) -> Result<ResponseContent<OrganizationResponse>, Error<UpdateOrgError>>
pub async fn update_org_with_http_info( &self, public_id: String, body: Organization, ) -> Result<ResponseContent<OrganizationResponse>, Error<UpdateOrgError>>
Update your organization.
Sourcepub async fn upload_idp_for_org(
&self,
public_id: String,
idp_file: Vec<u8>,
) -> Result<IdpResponse, Error<UploadIdPForOrgError>>
pub async fn upload_idp_for_org( &self, public_id: String, idp_file: Vec<u8>, ) -> Result<IdpResponse, Error<UploadIdPForOrgError>>
There are a couple of options for updating the Identity Provider (IdP) metadata from your SAML IdP.
-
Multipart Form-Data: Post the IdP metadata file using a form post.
-
XML Body: Post the IdP metadata file as the body of the request.
Examples found in repository?
7async fn main() {
8 let configuration = datadog::Configuration::new();
9 let api = OrganizationsAPI::with_config(configuration);
10 let resp = api
11 .upload_idp_for_org(
12 "abc123".to_string(),
13 fs::read("./idp_metadata.xml").unwrap(),
14 )
15 .await;
16 if let Ok(value) = resp {
17 println!("{:#?}", value);
18 } else {
19 println!("{:#?}", resp.unwrap_err());
20 }
21}
Sourcepub async fn upload_idp_for_org_with_http_info(
&self,
public_id: String,
idp_file: Vec<u8>,
) -> Result<ResponseContent<IdpResponse>, Error<UploadIdPForOrgError>>
pub async fn upload_idp_for_org_with_http_info( &self, public_id: String, idp_file: Vec<u8>, ) -> Result<ResponseContent<IdpResponse>, Error<UploadIdPForOrgError>>
There are a couple of options for updating the Identity Provider (IdP) metadata from your SAML IdP.
-
Multipart Form-Data: Post the IdP metadata file using a form post.
-
XML Body: Post the IdP metadata file as the body of the request.
Trait Implementations§
Source§impl Clone for OrganizationsAPI
impl Clone for OrganizationsAPI
Source§fn clone(&self) -> OrganizationsAPI
fn clone(&self) -> OrganizationsAPI
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more