Struct graph_rs_sdk::Graph

source ·
pub struct Graph { /* private fields */ }

Implementations§

source§

impl Graph

source

pub fn new(access_token: &str) -> Graph

source

pub fn v1(&mut self) -> &mut Graph

Use the v1 endpoint for the Microsoft Graph API. This is the default endpoint used by the client.

Example
use graph_rs_sdk::Graph;

let mut client = Graph::new("ACCESS_TOKEN");

client.v1()
    .me()
    .get_user()
    .send()
    .await?;
source

pub fn use_v1(&mut self)

Use the v1 endpoint for the Microsoft Graph API. Same as calling v1() but takes a mutable reference to self and does not return self.

Example
use graph_rs_sdk::Graph;

let mut client = Graph::new("ACCESS_TOKEN");
client.use_v1();

assert_eq!(client.url().to_string(), GRAPH_URL.to_string())
source

pub fn beta(&mut self) -> &mut Graph

Use the beta endpoint for the Microsoft Graph API

Example
use graph_rs_sdk::Graph;

let mut client = Graph::new("ACCESS_TOKEN");

client.beta()
    .me()
    .get_user()
    .send()
    .await?;
source

pub fn use_beta(&mut self)

Use the beta endpoint for the Microsoft Graph API. Same as calling beta() but takes a mutable reference to self and does not return self.

Example

use graph_rs_sdk::Graph;

let mut client = Graph::new("ACCESS_TOKEN");
client.use_beta();

assert_eq!(client.url().to_string(), GRAPH_URL_BETA.to_string())
source

pub fn url(&self) -> &Url

source

pub fn custom_endpoint(&mut self, custom_endpoint: &str) -> &mut Graph

Set a custom endpoint for the Microsoft Graph API

See microsoft-graph-and-graph-explorer-service-root-endpoints

Example

use graph_rs_sdk::Graph;

let mut client = Graph::new("ACCESS_TOKEN");

client.custom_endpoint("https://api.microsoft.com/api")
    .me()
    .get_user()
    .send()
    .await?;
source

pub fn use_endpoint(&mut self, custom_endpoint: &str)

Set a custom endpoint for the Microsoft Graph API

See microsoft-graph-and-graph-explorer-service-root-endpoints

Example

use graph_rs_sdk::Graph;

let mut client = Graph::new("ACCESS_TOKEN");
client.use_endpoint("https://graph.microsoft.com");

assert_eq!(client.url().to_string(), "https://graph.microsoft.com/".to_string())
source

pub fn admin(&self) -> AdminApiClient

source

pub fn app_catalogs(&self) -> AppCatalogsApiClient

source

pub fn agreement_acceptances(&self) -> AgreementAcceptancesApiClient

source

pub fn agreement_acceptance<S: AsRef<str>>( &self, id: S ) -> AgreementAcceptancesIdApiClient

source

pub fn agreements(&self) -> AgreementsApiClient

source

pub fn agreement<S: AsRef<str>>(&self, id: S) -> AgreementsIdApiClient

source

pub fn applications(&self) -> ApplicationsApiClient

source

pub fn application<S: AsRef<str>>(&self, id: S) -> ApplicationsIdApiClient

source

pub fn audit_logs(&self) -> AuditLogsApiClient

source

pub fn authentication_method_configurations( &self ) -> AuthenticationMethodConfigurationsApiClient

source

pub fn authentication_method_configuration<S: AsRef<str>>( &self, id: S ) -> AuthenticationMethodConfigurationsIdApiClient

source

pub fn authentication_methods_policy( &self ) -> AuthenticationMethodsPolicyApiClient

source

pub fn branding(&self) -> BrandingApiClient

source

pub fn certificate_based_auth_configurations( &self ) -> CertificateBasedAuthConfigurationApiClient

source

pub fn certificate_based_auth_configuration<S: AsRef<str>>( &self, id: S ) -> CertificateBasedAuthConfigurationIdApiClient

source

pub fn chats(&self) -> ChatsApiClient

source

pub fn chat<S: AsRef<str>>(&self, id: S) -> ChatsIdApiClient

source

pub fn communications(&self) -> CommunicationsApiClient

source

pub fn contracts(&self) -> ContractsApiClient

source

pub fn contract<S: AsRef<str>>(&self, id: S) -> ContractsIdApiClient

source

pub fn data_policy_operations(&self) -> DataPolicyOperationsApiClient

source

pub fn device_app_management(&self) -> DeviceAppManagementApiClient

source

pub fn device_management(&self) -> DeviceManagementApiClient

source

pub fn directory(&self) -> DirectoryApiClient

source

pub fn directory_objects(&self) -> DirectoryObjectsApiClient

source

pub fn directory_object<S: AsRef<str>>( &self, id: S ) -> DirectoryObjectsIdApiClient

source

pub fn directory_role_templates(&self) -> DirectoryRoleTemplatesApiClient

source

pub fn directory_role_template<S: AsRef<str>>( &self, id: S ) -> DirectoryRoleTemplatesIdApiClient

source

pub fn directory_roles(&self) -> DirectoryRolesApiClient

source

pub fn directory_role<S: AsRef<str>>(&self, id: S) -> DirectoryRolesIdApiClient

source

pub fn domain_dns_records(&self) -> DomainDnsRecordsApiClient

source

pub fn domain_dns_record<S: AsRef<str>>( &self, id: S ) -> DomainDnsRecordsIdApiClient

source

pub fn domains(&self) -> DomainsApiClient

source

pub fn domain<S: AsRef<str>>(&self, id: S) -> DomainsIdApiClient

source

pub fn drives(&self) -> DrivesApiClient

source

pub fn drive<S: AsRef<str>>(&self, id: S) -> DrivesIdApiClient

source

pub fn default_drive(&self) -> DefaultDriveApiClient

source

pub fn education(&self) -> EducationApiClient

source

pub fn groups(&self) -> GroupsApiClient

source

pub fn group<S: AsRef<str>>(&self, id: S) -> GroupsIdApiClient

source

pub fn group_lifecycle_policies(&self) -> GroupLifecyclePoliciesApiClient

source

pub fn group_lifecycle_policy<S: AsRef<str>>( &self, id: S ) -> GroupLifecyclePoliciesIdApiClient

source

pub fn identity(&self) -> IdentityApiClient

source

pub fn identity_governance(&self) -> IdentityGovernanceApiClient

source

pub fn identity_providers(&self) -> IdentityProvidersApiClient

source

pub fn identity_provider<S: AsRef<str>>( &self, id: S ) -> IdentityProvidersIdApiClient

source

pub fn invitations(&self) -> InvitationsApiClient

source

pub fn me(&self) -> MeApiClient

source

pub fn oauth2_permission_grants(&self) -> Oauth2PermissionGrantsApiClient

source

pub fn oauth2_permission_grant<S: AsRef<str>>( &self, id: S ) -> Oauth2PermissionGrantsIdApiClient

source

pub fn organizations(&self) -> OrganizationApiClient

source

pub fn organization<S: AsRef<str>>(&self, id: S) -> OrganizationIdApiClient

source

pub fn places(&self) -> PlacesApiClient

source

pub fn permission_grants(&self) -> PermissionGrantsApiClient

source

pub fn permission_grant<S: AsRef<str>>( &self, id: S ) -> PermissionGrantsIdApiClient

source

pub fn planner(&self) -> PlannerApiClient

source

pub fn policies(&self) -> PoliciesApiClient

source

pub fn reports(&self) -> ReportsApiClient

source

pub fn schema_extensions(&self) -> SchemaExtensionsApiClient

source

pub fn schema_extension<S: AsRef<str>>( &self, id: S ) -> SchemaExtensionsIdApiClient

source

pub fn service_principals(&self) -> ServicePrincipalsApiClient

source

pub fn service_principal<S: AsRef<str>>( &self, id: S ) -> ServicePrincipalsIdApiClient

source

pub fn sites(&self) -> SitesApiClient

source

pub fn site<S: AsRef<str>>(&self, id: S) -> SitesIdApiClient

source

pub fn subscribed_skus(&self) -> SubscribedSkusApiClient

source

pub fn subscribed_sku<S: AsRef<str>>(&self, id: S) -> SubscriptionsIdApiClient

source

pub fn subscriptions(&self) -> SubscriptionsApiClient

source

pub fn subscription<S: AsRef<str>>(&self, id: S) -> SubscriptionsIdApiClient

source

pub fn teams(&self) -> TeamsApiClient

source

pub fn team<S: AsRef<str>>(&self, id: S) -> TeamsIdApiClient

source

pub fn teams_templates(&self) -> TeamsTemplatesApiClient

source

pub fn teams_template<S: AsRef<str>>(&self, id: S) -> TeamsTemplatesIdApiClient

source

pub fn teamwork(&self) -> TeamworkApiClient

source

pub fn users(&self) -> UsersApiClient

source

pub fn user<S: AsRef<str>>(&self, id: S) -> UsersIdApiClient

source

pub fn custom(&self, method: Method, body: Option<BodyRead>) -> RequestHandler

source

pub fn batch<B: Serialize>(&self, batch: &B) -> RequestHandler

Trait Implementations§

source§

impl Clone for Graph

source§

fn clone(&self) -> Graph

Returns a copy 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 Graph

source§

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

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

impl From<&AccessToken> for Graph

source§

fn from(token: &AccessToken) -> Self

Converts to this type from the input type.
source§

impl From<&str> for Graph

source§

fn from(token: &str) -> Self

Converts to this type from the input type.
source§

impl From<GraphClientConfiguration> for Graph

source§

fn from(graph_client_builder: GraphClientConfiguration) -> Self

Converts to this type from the input type.
source§

impl From<String> for Graph

source§

fn from(token: String) -> Self

Converts to this type from the input type.
source§

impl TryFrom<&OAuth> for Graph

§

type Error = GraphFailure

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

fn try_from(oauth: &OAuth) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Graph

§

impl Send for Graph

§

impl Sync for Graph

§

impl Unpin for Graph

§

impl !UnwindSafe for Graph

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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,

§

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>,

§

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>,

§

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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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