make regen-apis

This commit is contained in:
OMGeeky
2024-05-16 21:23:40 +02:00
parent 52d2e89e51
commit ad85cafeef
5108 changed files with 1615625 additions and 992044 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,123 @@
use super::*;
/// Central instance to access all AndroidManagement related resource activities
///
/// # Examples
///
/// Instantiate a new hub
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_androidmanagement1 as androidmanagement1;
/// use androidmanagement1::api::Enterprise;
/// use androidmanagement1::{Result, Error};
/// use androidmanagement1::api::enums::*;
/// # async fn dox() {
/// use std::default::Default;
/// use androidmanagement1::{AndroidManagement, oauth2, hyper, hyper_rustls, chrono, FieldMask};
///
/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
/// // `client_secret`, among other things.
/// let secret: oauth2::ApplicationSecret = Default::default();
/// // Instantiate the authenticator. It will choose a suitable authentication flow for you,
/// // unless you replace `None` with the desired Flow.
/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
/// // retrieve them from storage.
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
/// secret,
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
/// ).build().await.unwrap();
/// let mut hub = AndroidManagement::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
/// // As the method needs a request, you would usually fill it with the desired information
/// // into the respective structure. Some of the parts shown here might not be applicable !
/// // Values shown here are possibly random and not representative !
/// let mut req = Enterprise::default();
///
/// // You can configure optional parameters by calling the respective setters at will, and
/// // execute the final call using `doit()`.
/// // Values shown here are possibly random and not representative !
/// let result = hub.enterprises().create(req)
/// .signup_url_name("amet.")
/// .project_id("takimata")
/// .enterprise_token("amet.")
/// .agreement_accepted(true)
/// .doit().await;
///
/// match result {
/// Err(e) => match e {
/// // The Error enum provides details about what exactly happened.
/// // You can also just use its `Debug`, `Display` or `Error` traits
/// Error::HttpError(_)
/// |Error::Io(_)
/// |Error::MissingAPIKey
/// |Error::MissingToken(_)
/// |Error::Cancelled
/// |Error::UploadSizeLimitExceeded(_, _)
/// |Error::Failure(_)
/// |Error::BadRequest(_)
/// |Error::FieldClash(_)
/// |Error::JsonDecodeError(_, _) => println!("{}", e),
/// },
/// Ok(res) => println!("Success: {:?}", res),
/// }
/// # }
/// ```
#[derive(Clone)]
pub struct AndroidManagement<S> {
pub client: hyper::Client<S, hyper::body::Body>,
pub auth: Box<dyn client::GetToken>,
pub(super) _user_agent: String,
pub(super) _base_url: String,
pub(super) _root_url: String,
}
impl<'a, S> client::Hub for AndroidManagement<S> {}
impl<'a, S> AndroidManagement<S> {
pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> AndroidManagement<S> {
AndroidManagement {
client,
auth: Box::new(auth),
_user_agent: "google-api-rust-client/5.0.5".to_string(),
_base_url: "https://androidmanagement.googleapis.com/".to_string(),
_root_url: "https://androidmanagement.googleapis.com/".to_string(),
}
}
pub fn enterprises(&'a self) -> EnterpriseMethods<'a, S> {
EnterpriseMethods { hub: &self }
}
pub fn provisioning_info(&'a self) -> ProvisioningInfoMethods<'a, S> {
ProvisioningInfoMethods { hub: &self }
}
pub fn signup_urls(&'a self) -> SignupUrlMethods<'a, S> {
SignupUrlMethods { hub: &self }
}
/// Set the user-agent header field to use in all requests to the server.
/// It defaults to `google-api-rust-client/5.0.5`.
///
/// Returns the previously set user-agent.
pub fn user_agent(&mut self, agent_name: String) -> String {
mem::replace(&mut self._user_agent, agent_name)
}
/// Set the base url to use in all requests to the server.
/// It defaults to `https://androidmanagement.googleapis.com/`.
///
/// Returns the previously set base url.
pub fn base_url(&mut self, new_base_url: String) -> String {
mem::replace(&mut self._base_url, new_base_url)
}
/// Set the root url to use in all requests to the server.
/// It defaults to `https://androidmanagement.googleapis.com/`.
///
/// Returns the previously set root url.
pub fn root_url(&mut self, new_root_url: String) -> String {
mem::replace(&mut self._root_url, new_root_url)
}
}

View File

@@ -0,0 +1,723 @@
use super::*;
/// A builder providing access to all methods supported on *enterprise* resources.
/// It is not used directly, but through the [`AndroidManagement`] hub.
///
/// # Example
///
/// Instantiate a resource builder
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_androidmanagement1 as androidmanagement1;
///
/// # async fn dox() {
/// use std::default::Default;
/// use androidmanagement1::{AndroidManagement, oauth2, hyper, hyper_rustls, chrono, FieldMask};
///
/// let secret: oauth2::ApplicationSecret = Default::default();
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
/// secret,
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
/// ).build().await.unwrap();
/// let mut hub = AndroidManagement::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
/// // like `applications_get(...)`, `create(...)`, `delete(...)`, `devices_delete(...)`, `devices_get(...)`, `devices_issue_command(...)`, `devices_list(...)`, `devices_operations_cancel(...)`, `devices_operations_get(...)`, `devices_operations_list(...)`, `devices_patch(...)`, `enrollment_tokens_create(...)`, `enrollment_tokens_delete(...)`, `enrollment_tokens_get(...)`, `enrollment_tokens_list(...)`, `get(...)`, `list(...)`, `migration_tokens_create(...)`, `migration_tokens_get(...)`, `migration_tokens_list(...)`, `patch(...)`, `policies_delete(...)`, `policies_get(...)`, `policies_list(...)`, `policies_patch(...)`, `web_apps_create(...)`, `web_apps_delete(...)`, `web_apps_get(...)`, `web_apps_list(...)`, `web_apps_patch(...)` and `web_tokens_create(...)`
/// // to build up your call.
/// let rb = hub.enterprises();
/// # }
/// ```
pub struct EnterpriseMethods<'a, S>
where S: 'a {
pub(super) hub: &'a AndroidManagement<S>,
}
impl<'a, S> client::MethodsBuilder for EnterpriseMethods<'a, S> {}
impl<'a, S> EnterpriseMethods<'a, S> {
/// Create a builder to help you perform the following task:
///
/// Gets info about an application.
///
/// # Arguments
///
/// * `name` - The name of the application in the form enterprises/{enterpriseId}/applications/{package_name}.
pub fn applications_get(&self, name: &str) -> EnterpriseApplicationGetCall<'a, S> {
EnterpriseApplicationGetCall {
hub: self.hub,
_name: name.to_string(),
_language_code: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.
///
/// # Arguments
///
/// * `name` - The name of the operation resource to be cancelled.
pub fn devices_operations_cancel(&self, name: &str) -> EnterpriseDeviceOperationCancelCall<'a, S> {
EnterpriseDeviceOperationCancelCall {
hub: self.hub,
_name: name.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
///
/// # Arguments
///
/// * `name` - The name of the operation resource.
pub fn devices_operations_get(&self, name: &str) -> EnterpriseDeviceOperationGetCall<'a, S> {
EnterpriseDeviceOperationGetCall {
hub: self.hub,
_name: name.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.
///
/// # Arguments
///
/// * `name` - The name of the operation's parent resource.
pub fn devices_operations_list(&self, name: &str) -> EnterpriseDeviceOperationListCall<'a, S> {
EnterpriseDeviceOperationListCall {
hub: self.hub,
_name: name.to_string(),
_page_token: Default::default(),
_page_size: Default::default(),
_filter: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Deletes a device. This operation wipes the device. Deleted devices do not show up in enterprises.devices.list calls and a 404 is returned from enterprises.devices.get.
///
/// # Arguments
///
/// * `name` - The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}.
pub fn devices_delete(&self, name: &str) -> EnterpriseDeviceDeleteCall<'a, S> {
EnterpriseDeviceDeleteCall {
hub: self.hub,
_name: name.to_string(),
_wipe_reason_message: Default::default(),
_wipe_data_flags: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Gets a device. Deleted devices will respond with a 404 error.
///
/// # Arguments
///
/// * `name` - The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}.
pub fn devices_get(&self, name: &str) -> EnterpriseDeviceGetCall<'a, S> {
EnterpriseDeviceGetCall {
hub: self.hub,
_name: name.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Issues a command to a device. The Operation resource returned contains a Command in its metadata field. Use the get operation method to get the status of the command.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}.
pub fn devices_issue_command(&self, request: Command, name: &str) -> EnterpriseDeviceIssueCommandCall<'a, S> {
EnterpriseDeviceIssueCommandCall {
hub: self.hub,
_request: request,
_name: name.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Lists devices for a given enterprise. Deleted devices are not returned in the response.
///
/// # Arguments
///
/// * `parent` - The name of the enterprise in the form enterprises/{enterpriseId}.
pub fn devices_list(&self, parent: &str) -> EnterpriseDeviceListCall<'a, S> {
EnterpriseDeviceListCall {
hub: self.hub,
_parent: parent.to_string(),
_page_token: Default::default(),
_page_size: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Updates a device.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}.
pub fn devices_patch(&self, request: Device, name: &str) -> EnterpriseDevicePatchCall<'a, S> {
EnterpriseDevicePatchCall {
hub: self.hub,
_request: request,
_name: name.to_string(),
_update_mask: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Creates an enrollment token for a given enterprise. It's up to the caller's responsibility to manage the lifecycle of newly created tokens and deleting them when they're not intended to be used anymore. Once an enrollment token has been created, it's not possible to retrieve the token's content anymore using AM API. It is recommended for EMMs to securely store the token if it's intended to be reused.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `parent` - The name of the enterprise in the form enterprises/{enterpriseId}.
pub fn enrollment_tokens_create(&self, request: EnrollmentToken, parent: &str) -> EnterpriseEnrollmentTokenCreateCall<'a, S> {
EnterpriseEnrollmentTokenCreateCall {
hub: self.hub,
_request: request,
_parent: parent.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Deletes an enrollment token. This operation invalidates the token, preventing its future use.
///
/// # Arguments
///
/// * `name` - The name of the enrollment token in the form enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}.
pub fn enrollment_tokens_delete(&self, name: &str) -> EnterpriseEnrollmentTokenDeleteCall<'a, S> {
EnterpriseEnrollmentTokenDeleteCall {
hub: self.hub,
_name: name.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Gets an active, unexpired enrollment token. Only a partial view of EnrollmentToken is returned: all the fields but name and expiration_timestamp are empty. This method is meant to help manage active enrollment tokens lifecycle. For security reasons, it's recommended to delete active enrollment tokens as soon as they're not intended to be used anymore.
///
/// # Arguments
///
/// * `name` - Required. The name of the enrollment token in the form enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}.
pub fn enrollment_tokens_get(&self, name: &str) -> EnterpriseEnrollmentTokenGetCall<'a, S> {
EnterpriseEnrollmentTokenGetCall {
hub: self.hub,
_name: name.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Lists active, unexpired enrollment tokens for a given enterprise. The list items contain only a partial view of EnrollmentToken: all the fields but name and expiration_timestamp are empty. This method is meant to help manage active enrollment tokens lifecycle. For security reasons, it's recommended to delete active enrollment tokens as soon as they're not intended to be used anymore.
///
/// # Arguments
///
/// * `parent` - Required. The name of the enterprise in the form enterprises/{enterpriseId}.
pub fn enrollment_tokens_list(&self, parent: &str) -> EnterpriseEnrollmentTokenListCall<'a, S> {
EnterpriseEnrollmentTokenListCall {
hub: self.hub,
_parent: parent.to_string(),
_page_token: Default::default(),
_page_size: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Creates a migration token, to migrate an existing device from being managed by the EMM's Device Policy Controller (DPC) to being managed by the Android Management API. See the guide (https://developers.google.com/android/management/dpc-migration) for more details.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `parent` - Required. The enterprise in which this migration token is created. This must be the same enterprise which already manages the device in the Play EMM API. Format: enterprises/{enterprise}
pub fn migration_tokens_create(&self, request: MigrationToken, parent: &str) -> EnterpriseMigrationTokenCreateCall<'a, S> {
EnterpriseMigrationTokenCreateCall {
hub: self.hub,
_request: request,
_parent: parent.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Gets a migration token.
///
/// # Arguments
///
/// * `name` - Required. The name of the migration token to retrieve. Format: enterprises/{enterprise}/migrationTokens/{migration_token}
pub fn migration_tokens_get(&self, name: &str) -> EnterpriseMigrationTokenGetCall<'a, S> {
EnterpriseMigrationTokenGetCall {
hub: self.hub,
_name: name.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Lists migration tokens.
///
/// # Arguments
///
/// * `parent` - Required. The enterprise which the migration tokens belong to. Format: enterprises/{enterprise}
pub fn migration_tokens_list(&self, parent: &str) -> EnterpriseMigrationTokenListCall<'a, S> {
EnterpriseMigrationTokenListCall {
hub: self.hub,
_parent: parent.to_string(),
_page_token: Default::default(),
_page_size: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Deletes a policy. This operation is only permitted if no devices are currently referencing the policy.
///
/// # Arguments
///
/// * `name` - The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}.
pub fn policies_delete(&self, name: &str) -> EnterprisePolicyDeleteCall<'a, S> {
EnterprisePolicyDeleteCall {
hub: self.hub,
_name: name.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Gets a policy.
///
/// # Arguments
///
/// * `name` - The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}.
pub fn policies_get(&self, name: &str) -> EnterprisePolicyGetCall<'a, S> {
EnterprisePolicyGetCall {
hub: self.hub,
_name: name.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Lists policies for a given enterprise.
///
/// # Arguments
///
/// * `parent` - The name of the enterprise in the form enterprises/{enterpriseId}.
pub fn policies_list(&self, parent: &str) -> EnterprisePolicyListCall<'a, S> {
EnterprisePolicyListCall {
hub: self.hub,
_parent: parent.to_string(),
_page_token: Default::default(),
_page_size: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Updates or creates a policy.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}.
pub fn policies_patch(&self, request: Policy, name: &str) -> EnterprisePolicyPatchCall<'a, S> {
EnterprisePolicyPatchCall {
hub: self.hub,
_request: request,
_name: name.to_string(),
_update_mask: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Creates a web app.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `parent` - The name of the enterprise in the form enterprises/{enterpriseId}.
pub fn web_apps_create(&self, request: WebApp, parent: &str) -> EnterpriseWebAppCreateCall<'a, S> {
EnterpriseWebAppCreateCall {
hub: self.hub,
_request: request,
_parent: parent.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Deletes a web app.
///
/// # Arguments
///
/// * `name` - The name of the web app in the form enterprises/{enterpriseId}/webApps/{packageName}.
pub fn web_apps_delete(&self, name: &str) -> EnterpriseWebAppDeleteCall<'a, S> {
EnterpriseWebAppDeleteCall {
hub: self.hub,
_name: name.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Gets a web app.
///
/// # Arguments
///
/// * `name` - The name of the web app in the form enterprises/{enterpriseId}/webApp/{packageName}.
pub fn web_apps_get(&self, name: &str) -> EnterpriseWebAppGetCall<'a, S> {
EnterpriseWebAppGetCall {
hub: self.hub,
_name: name.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Lists web apps for a given enterprise.
///
/// # Arguments
///
/// * `parent` - The name of the enterprise in the form enterprises/{enterpriseId}.
pub fn web_apps_list(&self, parent: &str) -> EnterpriseWebAppListCall<'a, S> {
EnterpriseWebAppListCall {
hub: self.hub,
_parent: parent.to_string(),
_page_token: Default::default(),
_page_size: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Updates a web app.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - The name of the web app in the form enterprises/{enterpriseId}/webApps/{packageName}.
pub fn web_apps_patch(&self, request: WebApp, name: &str) -> EnterpriseWebAppPatchCall<'a, S> {
EnterpriseWebAppPatchCall {
hub: self.hub,
_request: request,
_name: name.to_string(),
_update_mask: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Creates a web token to access an embeddable managed Google Play web UI for a given enterprise.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `parent` - The name of the enterprise in the form enterprises/{enterpriseId}.
pub fn web_tokens_create(&self, request: WebToken, parent: &str) -> EnterpriseWebTokenCreateCall<'a, S> {
EnterpriseWebTokenCreateCall {
hub: self.hub,
_request: request,
_parent: parent.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Creates an enterprise. This is the last step in the enterprise signup flow. See also: SigninDetail
///
/// # Arguments
///
/// * `request` - No description provided.
pub fn create(&self, request: Enterprise) -> EnterpriseCreateCall<'a, S> {
EnterpriseCreateCall {
hub: self.hub,
_request: request,
_signup_url_name: Default::default(),
_project_id: Default::default(),
_enterprise_token: Default::default(),
_agreement_accepted: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Permanently deletes an enterprise and all accounts and data associated with it. Warning: this will result in a cascaded deletion of all AM API devices associated with the deleted enterprise. Only available for EMM-managed enterprises.
///
/// # Arguments
///
/// * `name` - The name of the enterprise in the form enterprises/{enterpriseId}.
pub fn delete(&self, name: &str) -> EnterpriseDeleteCall<'a, S> {
EnterpriseDeleteCall {
hub: self.hub,
_name: name.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Gets an enterprise.
///
/// # Arguments
///
/// * `name` - The name of the enterprise in the form enterprises/{enterpriseId}.
pub fn get(&self, name: &str) -> EnterpriseGetCall<'a, S> {
EnterpriseGetCall {
hub: self.hub,
_name: name.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Lists EMM-managed enterprises. Only BASIC fields are returned.
pub fn list(&self) -> EnterpriseListCall<'a, S> {
EnterpriseListCall {
hub: self.hub,
_view: Default::default(),
_project_id: Default::default(),
_page_token: Default::default(),
_page_size: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Updates an enterprise. See also: SigninDetail
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - The name of the enterprise in the form enterprises/{enterpriseId}.
pub fn patch(&self, request: Enterprise, name: &str) -> EnterprisePatchCall<'a, S> {
EnterprisePatchCall {
hub: self.hub,
_request: request,
_name: name.to_string(),
_update_mask: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
}
/// A builder providing access to all methods supported on *provisioningInfo* resources.
/// It is not used directly, but through the [`AndroidManagement`] hub.
///
/// # Example
///
/// Instantiate a resource builder
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_androidmanagement1 as androidmanagement1;
///
/// # async fn dox() {
/// use std::default::Default;
/// use androidmanagement1::{AndroidManagement, oauth2, hyper, hyper_rustls, chrono, FieldMask};
///
/// let secret: oauth2::ApplicationSecret = Default::default();
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
/// secret,
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
/// ).build().await.unwrap();
/// let mut hub = AndroidManagement::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
/// // like `get(...)`
/// // to build up your call.
/// let rb = hub.provisioning_info();
/// # }
/// ```
pub struct ProvisioningInfoMethods<'a, S>
where S: 'a {
pub(super) hub: &'a AndroidManagement<S>,
}
impl<'a, S> client::MethodsBuilder for ProvisioningInfoMethods<'a, S> {}
impl<'a, S> ProvisioningInfoMethods<'a, S> {
/// Create a builder to help you perform the following task:
///
/// Get the device provisioning information by the identifier provided in the sign-in url.
///
/// # Arguments
///
/// * `name` - Required. The identifier that Android Device Policy passes to the 3P sign-in page in the form of provisioningInfo/{provisioning_info}.
pub fn get(&self, name: &str) -> ProvisioningInfoGetCall<'a, S> {
ProvisioningInfoGetCall {
hub: self.hub,
_name: name.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
}
/// A builder providing access to all methods supported on *signupUrl* resources.
/// It is not used directly, but through the [`AndroidManagement`] hub.
///
/// # Example
///
/// Instantiate a resource builder
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_androidmanagement1 as androidmanagement1;
///
/// # async fn dox() {
/// use std::default::Default;
/// use androidmanagement1::{AndroidManagement, oauth2, hyper, hyper_rustls, chrono, FieldMask};
///
/// let secret: oauth2::ApplicationSecret = Default::default();
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
/// secret,
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
/// ).build().await.unwrap();
/// let mut hub = AndroidManagement::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
/// // like `create(...)`
/// // to build up your call.
/// let rb = hub.signup_urls();
/// # }
/// ```
pub struct SignupUrlMethods<'a, S>
where S: 'a {
pub(super) hub: &'a AndroidManagement<S>,
}
impl<'a, S> client::MethodsBuilder for SignupUrlMethods<'a, S> {}
impl<'a, S> SignupUrlMethods<'a, S> {
/// Create a builder to help you perform the following task:
///
/// Creates an enterprise signup URL.
pub fn create(&self) -> SignupUrlCreateCall<'a, S> {
SignupUrlCreateCall {
hub: self.hub,
_project_id: Default::default(),
_callback_url: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
}

View File

@@ -0,0 +1,35 @@
use std::collections::HashMap;
use std::cell::RefCell;
use std::default::Default;
use std::collections::BTreeSet;
use std::error::Error as StdError;
use serde_json as json;
use std::io;
use std::fs;
use std::mem;
use hyper::client::connect;
use tokio::io::{AsyncRead, AsyncWrite};
use tokio::time::sleep;
use tower_service;
use serde::{Serialize, Deserialize};
use crate::{client, client::GetToken, client::serde_with};
mod utilities;
pub use utilities::*;
mod hub;
pub use hub::*;
mod schemas;
pub use schemas::*;
mod method_builders;
pub use method_builders::*;
mod call_builders;
pub use call_builders::*;
pub mod enums;
pub(crate) use enums::*;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,24 @@
use super::*;
/// Identifies the an OAuth2 authorization scope.
/// A scope is needed when requesting an
/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication).
#[derive(PartialEq, Eq, Hash, Debug, Clone)]
pub enum Scope {
/// Manage Android devices and apps for your customers
Full,
}
impl AsRef<str> for Scope {
fn as_ref(&self) -> &str {
match *self {
Scope::Full => "https://www.googleapis.com/auth/androidmanagement",
}
}
}
impl Default for Scope {
fn default() -> Scope {
Scope::Full
}
}

View File

@@ -2,14 +2,14 @@
// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
// DO NOT EDIT !
//! This documentation was generated from *Android Management* crate version *5.0.4+20240221*, where *20240221* is the exact revision of the *androidmanagement:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.4*.
//! This documentation was generated from *Android Management* crate version *5.0.5+20240416*, where *20240416* is the exact revision of the *androidmanagement:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.5*.
//!
//! Everything else about the *Android Management* *v1* API can be found at the
//! [official documentation site](https://developers.google.com/android/management).
//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/androidmanagement1).
//! # Features
//!
//! Handle the following *Resources* with ease from the central [hub](AndroidManagement) ...
//! Handle the following *Resources* with ease from the central [hub](AndroidManagement) ...
//!
//! * [enterprises](api::Enterprise)
//! * [*applications get*](api::EnterpriseApplicationGetCall), [*create*](api::EnterpriseCreateCall), [*delete*](api::EnterpriseDeleteCall), [*devices delete*](api::EnterpriseDeviceDeleteCall), [*devices get*](api::EnterpriseDeviceGetCall), [*devices issue command*](api::EnterpriseDeviceIssueCommandCall), [*devices list*](api::EnterpriseDeviceListCall), [*devices operations cancel*](api::EnterpriseDeviceOperationCancelCall), [*devices operations get*](api::EnterpriseDeviceOperationGetCall), [*devices operations list*](api::EnterpriseDeviceOperationListCall), [*devices patch*](api::EnterpriseDevicePatchCall), [*enrollment tokens create*](api::EnterpriseEnrollmentTokenCreateCall), [*enrollment tokens delete*](api::EnterpriseEnrollmentTokenDeleteCall), [*enrollment tokens get*](api::EnterpriseEnrollmentTokenGetCall), [*enrollment tokens list*](api::EnterpriseEnrollmentTokenListCall), [*get*](api::EnterpriseGetCall), [*list*](api::EnterpriseListCall), [*migration tokens create*](api::EnterpriseMigrationTokenCreateCall), [*migration tokens get*](api::EnterpriseMigrationTokenGetCall), [*migration tokens list*](api::EnterpriseMigrationTokenListCall), [*patch*](api::EnterprisePatchCall), [*policies delete*](api::EnterprisePolicyDeleteCall), [*policies get*](api::EnterprisePolicyGetCall), [*policies list*](api::EnterprisePolicyListCall), [*policies patch*](api::EnterprisePolicyPatchCall), [*web apps create*](api::EnterpriseWebAppCreateCall), [*web apps delete*](api::EnterpriseWebAppDeleteCall), [*web apps get*](api::EnterpriseWebAppGetCall), [*web apps list*](api::EnterpriseWebAppListCall), [*web apps patch*](api::EnterpriseWebAppPatchCall) and [*web tokens create*](api::EnterpriseWebTokenCreateCall)
@@ -84,8 +84,8 @@
//! let r = hub.enterprises().patch(...).doit().await
//! ```
//!
//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
//! The `doit()` method performs the actual communication with the server and returns the respective result.
//!
@@ -110,23 +110,24 @@
//! extern crate google_androidmanagement1 as androidmanagement1;
//! use androidmanagement1::api::Enterprise;
//! use androidmanagement1::{Result, Error};
//! use androidmanagement1::api::enums::*;
//! # async fn dox() {
//! use std::default::Default;
//! use androidmanagement1::{AndroidManagement, oauth2, hyper, hyper_rustls, chrono, FieldMask};
//!
//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
//! // `client_secret`, among other things.
//! let secret: oauth2::ApplicationSecret = Default::default();
//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
//! // unless you replace `None` with the desired Flow.
//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
//! // retrieve them from storage.
//! let auth = oauth2::InstalledFlowAuthenticator::builder(
//! secret,
//! oauth2::InstalledFlowReturnMethod::HTTPRedirect,
//! ).build().await.unwrap();
//! let mut hub = AndroidManagement::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
//! let mut hub = AndroidManagement::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
//! // As the method needs a request, you would usually fill it with the desired information
//! // into the respective structure. Some of the parts shown here might not be applicable !
//! // Values shown here are possibly random and not representative !
@@ -164,10 +165,10 @@
//! ## Handling Errors
//!
//! All errors produced by the system are provided either as [Result](client::Result) enumeration as return value of
//! the doit() methods, or handed as possibly intermediate results to either the
//! the doit() methods, or handed as possibly intermediate results to either the
//! [Hub Delegate](client::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
//!
//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
//! makes the system potentially resilient to all kinds of errors.
//!
//! ## Uploads and Downloads
@@ -177,25 +178,25 @@
//! You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making
//! this call: `.param("alt", "media")`.
//!
//! Methods supporting uploads can do so using up to 2 different protocols:
//! *simple* and *resumable*. The distinctiveness of each is represented by customized
//! Methods supporting uploads can do so using up to 2 different protocols:
//! *simple* and *resumable*. The distinctiveness of each is represented by customized
//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
//!
//! ## Customization and Callbacks
//!
//! You may alter the way an `doit()` method is called by providing a [delegate](client::Delegate) to the
//! [Method Builder](client::CallBuilder) before making the final `doit()` call.
//! Respective methods will be called to provide progress information, as well as determine whether the system should
//! You may alter the way an `doit()` method is called by providing a [delegate](client::Delegate) to the
//! [Method Builder](client::CallBuilder) before making the final `doit()` call.
//! Respective methods will be called to provide progress information, as well as determine whether the system should
//! retry on failure.
//!
//! The [delegate trait](client::Delegate) is default-implemented, allowing you to customize it with minimal effort.
//!
//! ## Optional Parts in Server-Requests
//!
//! All structures provided by this library are made to be [encodable](client::RequestValue) and
//! [decodable](client::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
//! All structures provided by this library are made to be [encodable](client::RequestValue) and
//! [decodable](client::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
//! are valid.
//! Most optionals are are considered [Parts](client::Part) which are identifiable by name, which will be sent to
//! Most optionals are are considered [Parts](client::Part) which are identifiable by name, which will be sent to
//! the server to indicate either the set parts of the request or the desired parts in the response.
//!
//! ## Builder Arguments