mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
regen all APIs
This commit is contained in:
@@ -159,6 +159,11 @@ impl<'a, S> AndroidProvisioningPartner<S> {
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ClaimDeviceRequest {
|
||||
/// Optional. The ID of the configuration applied to the device section.
|
||||
#[serde(rename="configurationId")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub configuration_id: Option<i64>,
|
||||
/// The ID of the customer for whom the device is being claimed.
|
||||
#[serde(rename="customerId")]
|
||||
|
||||
@@ -184,7 +189,7 @@ pub struct ClaimDeviceRequest {
|
||||
#[serde(rename="sectionType")]
|
||||
|
||||
pub section_type: Option<String>,
|
||||
/// Optional. Must and can only be set when DeviceProvisioningSectionType is SECTION_TYPE_SIM_LOCK. The unique identifier of the SimLock profile (go/simlock/profiles).
|
||||
/// Optional. Must and can only be set when DeviceProvisioningSectionType is SECTION_TYPE_SIM_LOCK. The unique identifier of the SimLock profile.
|
||||
#[serde(rename="simlockProfileId")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
@@ -336,6 +341,11 @@ pub struct Configuration {
|
||||
#[serde(rename="dpcResourcePath")]
|
||||
|
||||
pub dpc_resource_path: Option<String>,
|
||||
/// Optional. The timeout before forcing factory reset the device if the device doesn't go through provisioning in the setup wizard, usually due to lack of network connectivity during setup wizard. Ranges from 0-6 hours, with 2 hours being the default if unset.
|
||||
#[serde(rename="forcedResetTime")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde::duration::Wrapper>")]
|
||||
pub forced_reset_time: Option<client::chrono::Duration>,
|
||||
/// Required. Whether this is the default configuration that zero-touch enrollment applies to any new devices the organization purchases in the future. Only one customer configuration can be the default. Setting this value to `true`, changes the previous default configuration's `isDefault` value to `false`.
|
||||
#[serde(rename="isDefault")]
|
||||
|
||||
@@ -829,6 +839,46 @@ pub struct FindDevicesByOwnerResponse {
|
||||
impl client::ResponseResult for FindDevicesByOwnerResponse {}
|
||||
|
||||
|
||||
/// Request to get a device’s SIM lock status.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [devices get sim lock state partners](PartnerDeviceGetSimLockStateCall) (request)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GetDeviceSimLockStateRequest {
|
||||
/// Required. Required. The device identifier to search for.
|
||||
#[serde(rename="deviceIdentifier")]
|
||||
|
||||
pub device_identifier: Option<DeviceIdentifier>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for GetDeviceSimLockStateRequest {}
|
||||
|
||||
|
||||
/// Response containing a device’s SimLock state.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [devices get sim lock state partners](PartnerDeviceGetSimLockStateCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GetDeviceSimLockStateResponse {
|
||||
/// no description provided
|
||||
#[serde(rename="simLockState")]
|
||||
|
||||
pub sim_lock_state: Option<String>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for GetDeviceSimLockStateResponse {}
|
||||
|
||||
|
||||
/// A Google Workspace customer.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
@@ -972,6 +1022,11 @@ impl client::ResponseResult for Operation {}
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct PartnerClaim {
|
||||
/// Optional. The ID of the configuration applied to the device section.
|
||||
#[serde(rename="configurationId")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub configuration_id: Option<i64>,
|
||||
/// The ID of the customer for whom the device is being claimed.
|
||||
#[serde(rename="customerId")]
|
||||
|
||||
@@ -997,6 +1052,11 @@ pub struct PartnerClaim {
|
||||
#[serde(rename="sectionType")]
|
||||
|
||||
pub section_type: Option<String>,
|
||||
/// Optional. Must and can only be set when DeviceProvisioningSectionType is SECTION_TYPE_SIM_LOCK. The unique identifier of the SimLock profile.
|
||||
#[serde(rename="simlockProfileId")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub simlock_profile_id: Option<i64>,
|
||||
}
|
||||
|
||||
impl client::Part for PartnerClaim {}
|
||||
@@ -1504,7 +1564,7 @@ impl<'a, S> OperationMethods<'a, S> {
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = AndroidProvisioningPartner::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `customers_create(...)`, `customers_list(...)`, `devices_claim(...)`, `devices_claim_async(...)`, `devices_find_by_identifier(...)`, `devices_find_by_owner(...)`, `devices_get(...)`, `devices_metadata(...)`, `devices_unclaim(...)`, `devices_unclaim_async(...)`, `devices_update_metadata_async(...)`, `vendors_customers_list(...)` and `vendors_list(...)`
|
||||
/// // like `customers_create(...)`, `customers_list(...)`, `devices_claim(...)`, `devices_claim_async(...)`, `devices_find_by_identifier(...)`, `devices_find_by_owner(...)`, `devices_get(...)`, `devices_get_sim_lock_state(...)`, `devices_metadata(...)`, `devices_unclaim(...)`, `devices_unclaim_async(...)`, `devices_update_metadata_async(...)`, `vendors_customers_list(...)` and `vendors_list(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.partners();
|
||||
/// # }
|
||||
@@ -1643,6 +1703,24 @@ impl<'a, S> PartnerMethods<'a, S> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets a device's SIM lock state.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `partnerId` - Required. The ID of the partner.
|
||||
pub fn devices_get_sim_lock_state(&self, request: GetDeviceSimLockStateRequest, partner_id: i64) -> PartnerDeviceGetSimLockStateCall<'a, S> {
|
||||
PartnerDeviceGetSimLockStateCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_partner_id: partner_id,
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Updates reseller metadata associated with the device. Android devices only.
|
||||
@@ -6467,6 +6545,253 @@ where
|
||||
}
|
||||
|
||||
|
||||
/// Gets a device's SIM lock state.
|
||||
///
|
||||
/// A builder for the *devices.getSimLockState* method supported by a *partner* resource.
|
||||
/// It is not used directly, but through a [`PartnerMethods`] instance.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource method builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate google_androiddeviceprovisioning1 as androiddeviceprovisioning1;
|
||||
/// use androiddeviceprovisioning1::api::GetDeviceSimLockStateRequest;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use androiddeviceprovisioning1::{AndroidProvisioningPartner, 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 = AndroidProvisioningPartner::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().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 = GetDeviceSimLockStateRequest::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.partners().devices_get_sim_lock_state(req, -57)
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct PartnerDeviceGetSimLockStateCall<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
hub: &'a AndroidProvisioningPartner<S>,
|
||||
_request: GetDeviceSimLockStateRequest,
|
||||
_partner_id: i64,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
_additional_params: HashMap<String, String>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::CallBuilder for PartnerDeviceGetSimLockStateCall<'a, S> {}
|
||||
|
||||
impl<'a, S> PartnerDeviceGetSimLockStateCall<'a, S>
|
||||
where
|
||||
S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
|
||||
S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
|
||||
S::Future: Send + Unpin + 'static,
|
||||
S::Error: Into<Box<dyn StdError + Send + Sync>>,
|
||||
{
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, GetDeviceSimLockStateResponse)> {
|
||||
use std::io::{Read, Seek};
|
||||
use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
|
||||
use client::{ToParts, url::Params};
|
||||
use std::borrow::Cow;
|
||||
|
||||
let mut dd = client::DefaultDelegate;
|
||||
let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
|
||||
dlg.begin(client::MethodInfo { id: "androiddeviceprovisioning.partners.devices.getSimLockState",
|
||||
http_method: hyper::Method::POST });
|
||||
|
||||
for &field in ["alt", "partnerId"].iter() {
|
||||
if self._additional_params.contains_key(field) {
|
||||
dlg.finished(false);
|
||||
return Err(client::Error::FieldClash(field));
|
||||
}
|
||||
}
|
||||
|
||||
let mut params = Params::with_capacity(4 + self._additional_params.len());
|
||||
params.push("partnerId", self._partner_id.to_string());
|
||||
|
||||
params.extend(self._additional_params.iter());
|
||||
|
||||
params.push("alt", "json");
|
||||
let mut url = self.hub._base_url.clone() + "v1/partners/{+partnerId}/devices:getSimLockState";
|
||||
|
||||
match dlg.api_key() {
|
||||
Some(value) => params.push("key", value),
|
||||
None => {
|
||||
dlg.finished(false);
|
||||
return Err(client::Error::MissingAPIKey)
|
||||
}
|
||||
}
|
||||
|
||||
for &(find_this, param_name) in [("{+partnerId}", "partnerId")].iter() {
|
||||
url = params.uri_replacement(url, param_name, find_this, true);
|
||||
}
|
||||
{
|
||||
let to_remove = ["partnerId"];
|
||||
params.remove_params(&to_remove);
|
||||
}
|
||||
|
||||
let url = params.parse_with_url(&url);
|
||||
|
||||
let mut json_mime_type = mime::APPLICATION_JSON;
|
||||
let mut request_value_reader =
|
||||
{
|
||||
let mut value = json::value::to_value(&self._request).expect("serde to work");
|
||||
client::remove_json_null_values(&mut value);
|
||||
let mut dst = io::Cursor::new(Vec::with_capacity(128));
|
||||
json::to_writer(&mut dst, &value).unwrap();
|
||||
dst
|
||||
};
|
||||
let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
|
||||
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
|
||||
|
||||
|
||||
loop {
|
||||
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
|
||||
let mut req_result = {
|
||||
let client = &self.hub.client;
|
||||
dlg.pre_request();
|
||||
let mut req_builder = hyper::Request::builder()
|
||||
.method(hyper::Method::POST)
|
||||
.uri(url.as_str())
|
||||
.header(USER_AGENT, self.hub._user_agent.clone());
|
||||
|
||||
|
||||
|
||||
let request = req_builder
|
||||
.header(CONTENT_TYPE, json_mime_type.to_string())
|
||||
.header(CONTENT_LENGTH, request_size as u64)
|
||||
.body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
|
||||
|
||||
client.request(request.unwrap()).await
|
||||
|
||||
};
|
||||
|
||||
match req_result {
|
||||
Err(err) => {
|
||||
if let client::Retry::After(d) = dlg.http_error(&err) {
|
||||
sleep(d).await;
|
||||
continue;
|
||||
}
|
||||
dlg.finished(false);
|
||||
return Err(client::Error::HttpError(err))
|
||||
}
|
||||
Ok(mut res) => {
|
||||
if !res.status().is_success() {
|
||||
let res_body_string = client::get_body_as_string(res.body_mut()).await;
|
||||
let (parts, _) = res.into_parts();
|
||||
let body = hyper::Body::from(res_body_string.clone());
|
||||
let restored_response = hyper::Response::from_parts(parts, body);
|
||||
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d).await;
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
let res_body_string = client::get_body_as_string(res.body_mut()).await;
|
||||
|
||||
match json::from_str(&res_body_string) {
|
||||
Ok(decoded) => (res, decoded),
|
||||
Err(err) => {
|
||||
dlg.response_json_decode_error(&res_body_string, &err);
|
||||
return Err(client::Error::JsonDecodeError(res_body_string, err));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
dlg.finished(true);
|
||||
return Ok(result_value)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Sets the *request* property to the given value.
|
||||
///
|
||||
/// Even though the property as already been set when instantiating this call,
|
||||
/// we provide this method for API completeness.
|
||||
pub fn request(mut self, new_value: GetDeviceSimLockStateRequest) -> PartnerDeviceGetSimLockStateCall<'a, S> {
|
||||
self._request = new_value;
|
||||
self
|
||||
}
|
||||
/// Required. The ID of the partner.
|
||||
///
|
||||
/// Sets the *partner id* path property to the given value.
|
||||
///
|
||||
/// Even though the property as already been set when instantiating this call,
|
||||
/// we provide this method for API completeness.
|
||||
pub fn partner_id(mut self, new_value: i64) -> PartnerDeviceGetSimLockStateCall<'a, S> {
|
||||
self._partner_id = new_value;
|
||||
self
|
||||
}
|
||||
/// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
|
||||
/// while executing the actual API request.
|
||||
///
|
||||
/// ````text
|
||||
/// It should be used to handle progress information, and to implement a certain level of resilience.
|
||||
/// ````
|
||||
///
|
||||
/// Sets the *delegate* property to the given value.
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> PartnerDeviceGetSimLockStateCall<'a, S> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
|
||||
/// Set any additional parameter of the query string used in the request.
|
||||
/// It should be used to set parameters which are not yet available through their own
|
||||
/// setters.
|
||||
///
|
||||
/// Please note that this method must not be used to set any of the known parameters
|
||||
/// which have their own setter method. If done anyway, the request will fail.
|
||||
///
|
||||
/// # Additional Parameters
|
||||
///
|
||||
/// * *$.xgafv* (query-string) - V1 error format.
|
||||
/// * *access_token* (query-string) - OAuth access token.
|
||||
/// * *alt* (query-string) - Data format for response.
|
||||
/// * *callback* (query-string) - JSONP
|
||||
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
|
||||
/// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
|
||||
/// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
|
||||
/// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
|
||||
/// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
/// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
|
||||
/// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
|
||||
pub fn param<T>(mut self, name: T, value: T) -> PartnerDeviceGetSimLockStateCall<'a, S>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Updates reseller metadata associated with the device. Android devices only.
|
||||
///
|
||||
/// A builder for the *devices.metadata* method supported by a *partner* resource.
|
||||
@@ -6499,7 +6824,7 @@ where
|
||||
/// // 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.partners().devices_metadata(req, -57, -50)
|
||||
/// let result = hub.partners().devices_metadata(req, -50, -50)
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
@@ -6758,7 +7083,7 @@ where
|
||||
/// // 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.partners().devices_unclaim(req, -50)
|
||||
/// let result = hub.partners().devices_unclaim(req, -7)
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
@@ -7005,7 +7330,7 @@ where
|
||||
/// // 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.partners().devices_unclaim_async(req, -7)
|
||||
/// let result = hub.partners().devices_unclaim_async(req, -62)
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
@@ -7252,7 +7577,7 @@ where
|
||||
/// // 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.partners().devices_update_metadata_async(req, -62)
|
||||
/// let result = hub.partners().devices_update_metadata_async(req, -17)
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
@@ -7494,8 +7819,8 @@ where
|
||||
/// // execute the final call using `doit()`.
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let result = hub.partners().vendors_customers_list("parent")
|
||||
/// .page_token("dolor")
|
||||
/// .page_size(-56)
|
||||
/// .page_token("Lorem")
|
||||
/// .page_size(-25)
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
@@ -7735,8 +8060,8 @@ where
|
||||
/// // execute the final call using `doit()`.
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let result = hub.partners().vendors_list("parent")
|
||||
/// .page_token("labore")
|
||||
/// .page_size(-43)
|
||||
/// .page_token("sed")
|
||||
/// .page_size(-70)
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
|
||||
Reference in New Issue
Block a user