OrganizationsAPI

Struct OrganizationsAPI 

Source
pub struct OrganizationsAPI { /* private fields */ }
Expand description

Create, edit, and manage your organizations. Read more about multi-org accounts.

Implementations§

Source§

impl OrganizationsAPI

Source

pub fn new() -> Self

Source

pub fn with_config(config: Configuration) -> Self

Examples found in repository?
examples/v1_organizations_ListOrgs.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = OrganizationsAPI::with_config(configuration);
9    let resp = api.list_orgs().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
More examples
Hide additional examples
examples/v1_organizations_GetOrg.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = OrganizationsAPI::with_config(configuration);
9    let resp = api.get_org("abc123".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v1_organizations_DowngradeOrg.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = OrganizationsAPI::with_config(configuration);
9    let resp = api.downgrade_org("abc123".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v1_organizations_UploadIdPForOrg.rs (line 9)
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}
examples/v1_organizations_CreateChildOrg.rs (line 14)
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}
examples/v1_organizations_UpdateOrg.rs (line 43)
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}
Source

pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self

Source

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?
examples/v1_organizations_CreateChildOrg.rs (line 15)
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}
Source

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.

Source

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.

Examples found in repository?
examples/v1_organizations_DowngradeOrg.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = OrganizationsAPI::with_config(configuration);
9    let resp = api.downgrade_org("abc123".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

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.

Source

pub async fn get_org( &self, public_id: String, ) -> Result<OrganizationResponse, Error<GetOrgError>>

Get organization information.

Examples found in repository?
examples/v1_organizations_GetOrg.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = OrganizationsAPI::with_config(configuration);
9    let resp = api.get_org("abc123".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn get_org_with_http_info( &self, public_id: String, ) -> Result<ResponseContent<OrganizationResponse>, Error<GetOrgError>>

Get organization information.

Source

pub async fn list_orgs( &self, ) -> Result<OrganizationListResponse, Error<ListOrgsError>>

This endpoint returns data on your top-level organization.

Examples found in repository?
examples/v1_organizations_ListOrgs.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = OrganizationsAPI::with_config(configuration);
9    let resp = api.list_orgs().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn list_orgs_with_http_info( &self, ) -> Result<ResponseContent<OrganizationListResponse>, Error<ListOrgsError>>

This endpoint returns data on your top-level organization.

Source

pub async fn update_org( &self, public_id: String, body: Organization, ) -> Result<OrganizationResponse, Error<UpdateOrgError>>

Update your organization.

Examples found in repository?
examples/v1_organizations_UpdateOrg.rs (line 44)
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}
Source

pub async fn update_org_with_http_info( &self, public_id: String, body: Organization, ) -> Result<ResponseContent<OrganizationResponse>, Error<UpdateOrgError>>

Update your organization.

Source

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?
examples/v1_organizations_UploadIdPForOrg.rs (lines 11-14)
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}
Source

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

Source§

fn clone(&self) -> OrganizationsAPI

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OrganizationsAPI

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for OrganizationsAPI

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,