Struct graph_rs_sdk::Graph
source · pub struct Graph { /* private fields */ }
Implementations§
source§impl Graph
impl Graph
pub fn new(access_token: &str) -> Graph
sourcepub fn use_v1(&mut self)
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())
sourcepub fn use_beta(&mut self)
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())
pub fn url(&self) -> &Url
sourcepub fn custom_endpoint(&mut self, custom_endpoint: &str) -> &mut Graph
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?;
sourcepub fn use_endpoint(&mut self, custom_endpoint: &str)
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())
pub fn admin(&self) -> AdminApiClient
pub fn app_catalogs(&self) -> AppCatalogsApiClient
pub fn agreement_acceptances(&self) -> AgreementAcceptancesApiClient
pub fn agreement_acceptance<S: AsRef<str>>( &self, id: S ) -> AgreementAcceptancesIdApiClient
pub fn agreements(&self) -> AgreementsApiClient
pub fn agreement<S: AsRef<str>>(&self, id: S) -> AgreementsIdApiClient
pub fn applications(&self) -> ApplicationsApiClient
pub fn application<S: AsRef<str>>(&self, id: S) -> ApplicationsIdApiClient
pub fn audit_logs(&self) -> AuditLogsApiClient
pub fn authentication_method_configurations( &self ) -> AuthenticationMethodConfigurationsApiClient
pub fn authentication_method_configuration<S: AsRef<str>>( &self, id: S ) -> AuthenticationMethodConfigurationsIdApiClient
pub fn authentication_methods_policy( &self ) -> AuthenticationMethodsPolicyApiClient
pub fn branding(&self) -> BrandingApiClient
pub fn certificate_based_auth_configurations( &self ) -> CertificateBasedAuthConfigurationApiClient
pub fn certificate_based_auth_configuration<S: AsRef<str>>( &self, id: S ) -> CertificateBasedAuthConfigurationIdApiClient
pub fn chats(&self) -> ChatsApiClient
pub fn chat<S: AsRef<str>>(&self, id: S) -> ChatsIdApiClient
pub fn communications(&self) -> CommunicationsApiClient
pub fn contracts(&self) -> ContractsApiClient
pub fn contract<S: AsRef<str>>(&self, id: S) -> ContractsIdApiClient
pub fn data_policy_operations(&self) -> DataPolicyOperationsApiClient
pub fn device_app_management(&self) -> DeviceAppManagementApiClient
pub fn device_management(&self) -> DeviceManagementApiClient
pub fn directory(&self) -> DirectoryApiClient
pub fn directory_objects(&self) -> DirectoryObjectsApiClient
pub fn directory_object<S: AsRef<str>>( &self, id: S ) -> DirectoryObjectsIdApiClient
pub fn directory_role_templates(&self) -> DirectoryRoleTemplatesApiClient
pub fn directory_role_template<S: AsRef<str>>( &self, id: S ) -> DirectoryRoleTemplatesIdApiClient
pub fn directory_roles(&self) -> DirectoryRolesApiClient
pub fn directory_role<S: AsRef<str>>(&self, id: S) -> DirectoryRolesIdApiClient
pub fn domain_dns_records(&self) -> DomainDnsRecordsApiClient
pub fn domain_dns_record<S: AsRef<str>>( &self, id: S ) -> DomainDnsRecordsIdApiClient
pub fn domains(&self) -> DomainsApiClient
pub fn domain<S: AsRef<str>>(&self, id: S) -> DomainsIdApiClient
pub fn drives(&self) -> DrivesApiClient
pub fn drive<S: AsRef<str>>(&self, id: S) -> DrivesIdApiClient
pub fn default_drive(&self) -> DefaultDriveApiClient
pub fn education(&self) -> EducationApiClient
pub fn groups(&self) -> GroupsApiClient
pub fn group<S: AsRef<str>>(&self, id: S) -> GroupsIdApiClient
pub fn group_lifecycle_policies(&self) -> GroupLifecyclePoliciesApiClient
pub fn group_lifecycle_policy<S: AsRef<str>>( &self, id: S ) -> GroupLifecyclePoliciesIdApiClient
pub fn identity(&self) -> IdentityApiClient
pub fn identity_governance(&self) -> IdentityGovernanceApiClient
pub fn identity_providers(&self) -> IdentityProvidersApiClient
pub fn identity_provider<S: AsRef<str>>( &self, id: S ) -> IdentityProvidersIdApiClient
pub fn invitations(&self) -> InvitationsApiClient
pub fn me(&self) -> MeApiClient
pub fn oauth2_permission_grants(&self) -> Oauth2PermissionGrantsApiClient
pub fn oauth2_permission_grant<S: AsRef<str>>( &self, id: S ) -> Oauth2PermissionGrantsIdApiClient
pub fn organizations(&self) -> OrganizationApiClient
pub fn organization<S: AsRef<str>>(&self, id: S) -> OrganizationIdApiClient
pub fn places(&self) -> PlacesApiClient
pub fn permission_grants(&self) -> PermissionGrantsApiClient
pub fn permission_grant<S: AsRef<str>>( &self, id: S ) -> PermissionGrantsIdApiClient
pub fn planner(&self) -> PlannerApiClient
pub fn policies(&self) -> PoliciesApiClient
pub fn reports(&self) -> ReportsApiClient
pub fn schema_extensions(&self) -> SchemaExtensionsApiClient
pub fn schema_extension<S: AsRef<str>>( &self, id: S ) -> SchemaExtensionsIdApiClient
pub fn service_principals(&self) -> ServicePrincipalsApiClient
pub fn service_principal<S: AsRef<str>>( &self, id: S ) -> ServicePrincipalsIdApiClient
pub fn sites(&self) -> SitesApiClient
pub fn site<S: AsRef<str>>(&self, id: S) -> SitesIdApiClient
pub fn subscribed_skus(&self) -> SubscribedSkusApiClient
pub fn subscribed_sku<S: AsRef<str>>(&self, id: S) -> SubscriptionsIdApiClient
pub fn subscriptions(&self) -> SubscriptionsApiClient
pub fn subscription<S: AsRef<str>>(&self, id: S) -> SubscriptionsIdApiClient
pub fn teams(&self) -> TeamsApiClient
pub fn team<S: AsRef<str>>(&self, id: S) -> TeamsIdApiClient
pub fn teams_templates(&self) -> TeamsTemplatesApiClient
pub fn teams_template<S: AsRef<str>>(&self, id: S) -> TeamsTemplatesIdApiClient
pub fn teamwork(&self) -> TeamworkApiClient
pub fn users(&self) -> UsersApiClient
pub fn user<S: AsRef<str>>(&self, id: S) -> UsersIdApiClient
pub fn custom(&self, method: Method, body: Option<BodyRead>) -> RequestHandler
pub fn batch<B: Serialize>(&self, batch: &B) -> RequestHandler
Trait Implementations§
source§impl From<&AccessToken> for Graph
impl From<&AccessToken> for Graph
source§fn from(token: &AccessToken) -> Self
fn from(token: &AccessToken) -> Self
Converts to this type from the input type.
source§impl From<GraphClientConfiguration> for Graph
impl From<GraphClientConfiguration> for Graph
source§fn from(graph_client_builder: GraphClientConfiguration) -> Self
fn from(graph_client_builder: GraphClientConfiguration) -> Self
Converts to this type from the input type.
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more