mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
regen all APIs and validate them
This commit is contained in:
@@ -19,7 +19,7 @@ use crate::client;
|
||||
/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication).
|
||||
#[derive(PartialEq, Eq, Hash)]
|
||||
pub enum Scope {
|
||||
/// View and manage your data across Google Cloud Platform services
|
||||
/// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
||||
CloudPlatform,
|
||||
}
|
||||
|
||||
@@ -52,13 +52,11 @@ impl Default for Scope {
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate yup_oauth2 as oauth2;
|
||||
/// extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
/// use binaryauthorization1::{Result, Error};
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use oauth2;
|
||||
/// use binaryauthorization1::BinaryAuthorization;
|
||||
/// use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
|
||||
/// // `client_secret`, among other things.
|
||||
@@ -68,9 +66,9 @@ impl Default for Scope {
|
||||
/// // 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 = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
@@ -101,8 +99,8 @@ impl Default for Scope {
|
||||
/// ```
|
||||
#[derive(Clone)]
|
||||
pub struct BinaryAuthorization<> {
|
||||
client: hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>,
|
||||
auth: oauth2::authenticator::Authenticator<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>>,
|
||||
pub client: hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>,
|
||||
pub auth: oauth2::authenticator::Authenticator<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>>,
|
||||
_user_agent: String,
|
||||
_base_url: String,
|
||||
_root_url: String,
|
||||
@@ -116,7 +114,7 @@ impl<'a, > BinaryAuthorization<> {
|
||||
BinaryAuthorization {
|
||||
client,
|
||||
auth: authenticator,
|
||||
_user_agent: "google-api-rust-client/2.0.8".to_string(),
|
||||
_user_agent: "google-api-rust-client/3.0.0".to_string(),
|
||||
_base_url: "https://binaryauthorization.googleapis.com/".to_string(),
|
||||
_root_url: "https://binaryauthorization.googleapis.com/".to_string(),
|
||||
}
|
||||
@@ -130,7 +128,7 @@ impl<'a, > BinaryAuthorization<> {
|
||||
}
|
||||
|
||||
/// Set the user-agent header field to use in all requests to the server.
|
||||
/// It defaults to `google-api-rust-client/2.0.8`.
|
||||
/// It defaults to `google-api-rust-client/3.0.0`.
|
||||
///
|
||||
/// Returns the previously set user-agent.
|
||||
pub fn user_agent(&mut self, agent_name: String) -> String {
|
||||
@@ -184,7 +182,7 @@ impl client::Part for AdmissionRule {}
|
||||
///
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct AdmissionWhitelistPattern {
|
||||
/// An image name pattern to allowlist, in the form `registry/path/to/image`. This supports a trailing `*` as a wildcard, but this is allowed only in text after the `registry/` part.
|
||||
/// An image name pattern to allowlist, in the form `registry/path/to/image`. This supports a trailing `*` wildcard, but this is allowed only in text after the `registry/` part. This also supports a trailing `**` wildcard which matches subdirectories of a given entry.
|
||||
#[serde(rename="namePattern")]
|
||||
pub name_pattern: Option<String>,
|
||||
}
|
||||
@@ -225,6 +223,8 @@ impl client::Part for AttestationOccurrence {}
|
||||
pub struct Attestor {
|
||||
/// Optional. A descriptive comment. This field may be updated. The field may be displayed in chooser dialogs.
|
||||
pub description: Option<String>,
|
||||
/// Optional. Used to prevent updating the attestor when another request has updated it since it was retrieved.
|
||||
pub etag: Option<String>,
|
||||
/// Required. The resource name, in the format: `projects/*/attestors/*`. This field may not be updated.
|
||||
pub name: Option<String>,
|
||||
/// Output only. Time when the attestor was last updated.
|
||||
@@ -260,17 +260,17 @@ pub struct AttestorPublicKey {
|
||||
impl client::Part for AttestorPublicKey {}
|
||||
|
||||
|
||||
/// Associates `members` with a `role`.
|
||||
/// Associates `members`, or principals, with a `role`.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Binding {
|
||||
/// The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
|
||||
/// The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
|
||||
pub condition: Option<Expr>,
|
||||
/// Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
|
||||
/// Specifies the principals requesting access for a Cloud Platform resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
|
||||
pub members: Option<Vec<String>>,
|
||||
/// Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
|
||||
/// Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
|
||||
pub role: Option<String>,
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ pub struct Expr {
|
||||
impl client::Part for Expr {}
|
||||
|
||||
|
||||
/// An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 3 For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
|
||||
/// An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members`, or principals, to a single `role`. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
@@ -325,7 +325,7 @@ impl client::Part for Expr {}
|
||||
///
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct IamPolicy {
|
||||
/// Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member.
|
||||
/// Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`.
|
||||
pub bindings: Option<Vec<Binding>>,
|
||||
/// `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
|
||||
pub etag: Option<String>,
|
||||
@@ -412,16 +412,18 @@ pub struct Policy {
|
||||
pub default_admission_rule: Option<AdmissionRule>,
|
||||
/// Optional. A descriptive comment.
|
||||
pub description: Option<String>,
|
||||
/// Optional. Used to prevent updating the policy when another request has updated it since it was retrieved.
|
||||
pub etag: Option<String>,
|
||||
/// Optional. Controls the evaluation of a Google-maintained global admission policy for common system-level images. Images not covered by the global policy will be subject to the project admission policy. This setting has no effect when specified inside a global admission policy.
|
||||
#[serde(rename="globalPolicyEvaluationMode")]
|
||||
pub global_policy_evaluation_mode: Option<String>,
|
||||
/// Optional. Per-istio-service-identity admission rules. Istio service identity spec format: spiffe:///ns//sa/ or /ns//sa/ e.g. spiffe://example.com/ns/test-ns/sa/default
|
||||
/// Optional. Per-istio-service-identity admission rules. Istio service identity spec format: `spiffe:///ns//sa/` or `/ns//sa/` e.g. `spiffe://example.com/ns/test-ns/sa/default`
|
||||
#[serde(rename="istioServiceIdentityAdmissionRules")]
|
||||
pub istio_service_identity_admission_rules: Option<HashMap<String, AdmissionRule>>,
|
||||
/// Optional. Per-kubernetes-namespace admission rules. K8s namespace spec format: [a-z.-]+, e.g. 'some-namespace'
|
||||
/// Optional. Per-kubernetes-namespace admission rules. K8s namespace spec format: `[a-z.-]+`, e.g. `some-namespace`
|
||||
#[serde(rename="kubernetesNamespaceAdmissionRules")]
|
||||
pub kubernetes_namespace_admission_rules: Option<HashMap<String, AdmissionRule>>,
|
||||
/// Optional. Per-kubernetes-service-account admission rules. Service account spec format: `namespace:serviceaccount`. e.g. 'test-ns:default'
|
||||
/// Optional. Per-kubernetes-service-account admission rules. Service account spec format: `namespace:serviceaccount`. e.g. `test-ns:default`
|
||||
#[serde(rename="kubernetesServiceAccountAdmissionRules")]
|
||||
pub kubernetes_service_account_admission_rules: Option<HashMap<String, AdmissionRule>>,
|
||||
/// Output only. The resource name, in the format `projects/*/policy`. There is at most one policy per project.
|
||||
@@ -588,18 +590,16 @@ impl client::ResponseResult for ValidateAttestationOccurrenceResponse {}
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate yup_oauth2 as oauth2;
|
||||
/// extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use oauth2;
|
||||
/// use binaryauthorization1::BinaryAuthorization;
|
||||
/// use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
@@ -890,18 +890,16 @@ impl<'a> ProjectMethods<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate yup_oauth2 as oauth2;
|
||||
/// extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use oauth2;
|
||||
/// use binaryauthorization1::BinaryAuthorization;
|
||||
/// use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
@@ -958,18 +956,16 @@ impl<'a> SystempolicyMethods<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
/// use binaryauthorization1::api::Attestor;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use binaryauthorization1::BinaryAuthorization;
|
||||
/// # use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
@@ -1119,22 +1115,22 @@ impl<'a> ProjectAttestorCreateCall<'a> {
|
||||
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 json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -1258,17 +1254,15 @@ impl<'a> ProjectAttestorCreateCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use binaryauthorization1::BinaryAuthorization;
|
||||
/// # use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
@@ -1393,22 +1387,22 @@ impl<'a> ProjectAttestorDeleteCall<'a> {
|
||||
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 json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -1516,17 +1510,15 @@ impl<'a> ProjectAttestorDeleteCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use binaryauthorization1::BinaryAuthorization;
|
||||
/// # use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
@@ -1651,22 +1643,22 @@ impl<'a> ProjectAttestorGetCall<'a> {
|
||||
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 json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -1774,17 +1766,15 @@ impl<'a> ProjectAttestorGetCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use binaryauthorization1::BinaryAuthorization;
|
||||
/// # use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
@@ -1914,22 +1904,22 @@ impl<'a> ProjectAttestorGetIamPolicyCall<'a> {
|
||||
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 json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -1962,7 +1952,7 @@ impl<'a> ProjectAttestorGetIamPolicyCall<'a> {
|
||||
self._resource = new_value.to_string();
|
||||
self
|
||||
}
|
||||
/// Optional. The policy format version to be returned. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
|
||||
/// Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
|
||||
///
|
||||
/// Sets the *options.requested policy version* query property to the given value.
|
||||
pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectAttestorGetIamPolicyCall<'a> {
|
||||
@@ -2044,17 +2034,15 @@ impl<'a> ProjectAttestorGetIamPolicyCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use binaryauthorization1::BinaryAuthorization;
|
||||
/// # use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
@@ -2189,22 +2177,22 @@ impl<'a> ProjectAttestorListCall<'a> {
|
||||
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 json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -2326,18 +2314,16 @@ impl<'a> ProjectAttestorListCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
/// use binaryauthorization1::api::SetIamPolicyRequest;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use binaryauthorization1::BinaryAuthorization;
|
||||
/// # use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
@@ -2482,22 +2468,22 @@ impl<'a> ProjectAttestorSetIamPolicyCall<'a> {
|
||||
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 json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -2614,18 +2600,16 @@ impl<'a> ProjectAttestorSetIamPolicyCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
/// use binaryauthorization1::api::TestIamPermissionsRequest;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use binaryauthorization1::BinaryAuthorization;
|
||||
/// # use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
@@ -2770,22 +2754,22 @@ impl<'a> ProjectAttestorTestIamPermissionCall<'a> {
|
||||
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 json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -2902,18 +2886,16 @@ impl<'a> ProjectAttestorTestIamPermissionCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
/// use binaryauthorization1::api::Attestor;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use binaryauthorization1::BinaryAuthorization;
|
||||
/// # use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
@@ -3058,22 +3040,22 @@ impl<'a> ProjectAttestorUpdateCall<'a> {
|
||||
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 json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -3190,18 +3172,16 @@ impl<'a> ProjectAttestorUpdateCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
/// use binaryauthorization1::api::ValidateAttestationOccurrenceRequest;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use binaryauthorization1::BinaryAuthorization;
|
||||
/// # use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
@@ -3346,22 +3326,22 @@ impl<'a> ProjectAttestorValidateAttestationOccurrenceCall<'a> {
|
||||
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 json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -3478,17 +3458,15 @@ impl<'a> ProjectAttestorValidateAttestationOccurrenceCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use binaryauthorization1::BinaryAuthorization;
|
||||
/// # use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
@@ -3618,22 +3596,22 @@ impl<'a> ProjectPolicyGetIamPolicyCall<'a> {
|
||||
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 json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -3666,7 +3644,7 @@ impl<'a> ProjectPolicyGetIamPolicyCall<'a> {
|
||||
self._resource = new_value.to_string();
|
||||
self
|
||||
}
|
||||
/// Optional. The policy format version to be returned. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
|
||||
/// Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
|
||||
///
|
||||
/// Sets the *options.requested policy version* query property to the given value.
|
||||
pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectPolicyGetIamPolicyCall<'a> {
|
||||
@@ -3748,18 +3726,16 @@ impl<'a> ProjectPolicyGetIamPolicyCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
/// use binaryauthorization1::api::SetIamPolicyRequest;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use binaryauthorization1::BinaryAuthorization;
|
||||
/// # use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
@@ -3904,22 +3880,22 @@ impl<'a> ProjectPolicySetIamPolicyCall<'a> {
|
||||
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 json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -4036,18 +4012,16 @@ impl<'a> ProjectPolicySetIamPolicyCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
/// use binaryauthorization1::api::TestIamPermissionsRequest;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use binaryauthorization1::BinaryAuthorization;
|
||||
/// # use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
@@ -4192,22 +4166,22 @@ impl<'a> ProjectPolicyTestIamPermissionCall<'a> {
|
||||
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 json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -4324,17 +4298,15 @@ impl<'a> ProjectPolicyTestIamPermissionCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use binaryauthorization1::BinaryAuthorization;
|
||||
/// # use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
@@ -4459,22 +4431,22 @@ impl<'a> ProjectGetPolicyCall<'a> {
|
||||
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 json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -4582,18 +4554,16 @@ impl<'a> ProjectGetPolicyCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
/// use binaryauthorization1::api::Policy;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use binaryauthorization1::BinaryAuthorization;
|
||||
/// # use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
@@ -4738,22 +4708,22 @@ impl<'a> ProjectUpdatePolicyCall<'a> {
|
||||
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 json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -4870,17 +4840,15 @@ impl<'a> ProjectUpdatePolicyCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use binaryauthorization1::BinaryAuthorization;
|
||||
/// # use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
@@ -5005,22 +4973,22 @@ impl<'a> SystempolicyGetPolicyCall<'a> {
|
||||
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 json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
|
||||
@@ -69,37 +69,6 @@ pub trait ToParts {
|
||||
fn to_parts(&self) -> String;
|
||||
}
|
||||
|
||||
/// A utility type which can decode a server response that indicates error
|
||||
#[derive(Deserialize)]
|
||||
pub struct JsonServerError {
|
||||
pub error: String,
|
||||
pub error_description: Option<String>,
|
||||
}
|
||||
|
||||
/// A utility to represent detailed errors we might see in case there are BadRequests.
|
||||
/// The latter happen if the sent parameters or request structures are unsound
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
pub struct ErrorResponse {
|
||||
pub error: ServerError,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
pub struct ServerError {
|
||||
pub errors: Vec<ServerMessage>,
|
||||
pub code: u16,
|
||||
pub message: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
pub struct ServerMessage {
|
||||
pub domain: String,
|
||||
pub reason: String,
|
||||
pub message: String,
|
||||
#[serde(rename = "locationType")]
|
||||
pub location_type: Option<String>,
|
||||
pub location: Option<String>,
|
||||
}
|
||||
|
||||
/// A trait specifying functionality to help controlling any request performed by the API.
|
||||
/// The trait has a conservative default implementation.
|
||||
///
|
||||
@@ -190,8 +159,7 @@ pub trait Delegate: Send {
|
||||
fn http_failure(
|
||||
&mut self,
|
||||
_: &hyper::Response<hyper::body::Body>,
|
||||
_err: Option<JsonServerError>,
|
||||
_: Option<ServerError>,
|
||||
_err: Option<serde_json::Value>,
|
||||
) -> Retry {
|
||||
Retry::Abort
|
||||
}
|
||||
@@ -248,7 +216,7 @@ pub enum Error {
|
||||
|
||||
/// Represents information about a request that was not understood by the server.
|
||||
/// Details are included.
|
||||
BadRequest(ErrorResponse),
|
||||
BadRequest(serde_json::Value),
|
||||
|
||||
/// We needed an API key for authentication, but didn't obtain one.
|
||||
/// Neither through the authenticator, nor through the Delegate.
|
||||
@@ -295,21 +263,8 @@ impl Display for Error {
|
||||
"It is used as there are no Scopes defined for this method."
|
||||
)
|
||||
}
|
||||
Error::BadRequest(ref err) => {
|
||||
writeln!(f, "Bad Request ({}): {}", err.error.code, err.error.message)?;
|
||||
for err in err.error.errors.iter() {
|
||||
writeln!(
|
||||
f,
|
||||
" {}: {}, {}{}",
|
||||
err.domain,
|
||||
err.message,
|
||||
err.reason,
|
||||
match err.location {
|
||||
Some(ref loc) => format!("@{}", loc),
|
||||
None => String::new(),
|
||||
}
|
||||
)?;
|
||||
}
|
||||
Error::BadRequest(ref message) => {
|
||||
writeln!(f, "Bad Request: {}", message)?;
|
||||
Ok(())
|
||||
}
|
||||
Error::MissingToken(ref err) => {
|
||||
@@ -661,7 +616,7 @@ impl<'a, A> ResumableUploadHelper<'a, A> {
|
||||
RangeResponseHeader::from_bytes(hh.as_bytes())
|
||||
}
|
||||
None | Some(_) => {
|
||||
if let Retry::After(d) = self.delegate.http_failure(&r, None, None) {
|
||||
if let Retry::After(d) = self.delegate.http_failure(&r, None) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
@@ -757,7 +712,6 @@ impl<'a, A> ResumableUploadHelper<'a, A> {
|
||||
if let Retry::After(d) = self.delegate.http_failure(
|
||||
&reconstructed_result,
|
||||
json::from_str(&res_body_string).ok(),
|
||||
json::from_str(&res_body_string).ok(),
|
||||
) {
|
||||
sleep(d);
|
||||
continue;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This file was generated automatically from 'src/mako/api/lib.rs.mako'
|
||||
// DO NOT EDIT !
|
||||
|
||||
//! This documentation was generated from *Binary Authorization* crate version *2.0.8+20210318*, where *20210318* is the exact revision of the *binaryauthorization:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v2.0.8*.
|
||||
//! This documentation was generated from *Binary Authorization* crate version *3.0.0+20220225*, where *20220225* is the exact revision of the *binaryauthorization:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v3.0.0*.
|
||||
//!
|
||||
//! Everything else about the *Binary Authorization* *v1* API can be found at the
|
||||
//! [official documentation site](https://cloud.google.com/binary-authorization/).
|
||||
@@ -69,11 +69,8 @@
|
||||
//! ```toml
|
||||
//! [dependencies]
|
||||
//! google-binaryauthorization1 = "*"
|
||||
//! hyper = "^0.14"
|
||||
//! hyper-rustls = "^0.22"
|
||||
//! serde = "^1.0"
|
||||
//! serde_json = "^1.0"
|
||||
//! yup-oauth2 = "^5.0"
|
||||
//! ```
|
||||
//!
|
||||
//! ## A complete example
|
||||
@@ -81,13 +78,11 @@
|
||||
//! ```test_harness,no_run
|
||||
//! extern crate hyper;
|
||||
//! extern crate hyper_rustls;
|
||||
//! extern crate yup_oauth2 as oauth2;
|
||||
//! extern crate google_binaryauthorization1 as binaryauthorization1;
|
||||
//! use binaryauthorization1::{Result, Error};
|
||||
//! # async fn dox() {
|
||||
//! use std::default::Default;
|
||||
//! use oauth2;
|
||||
//! use binaryauthorization1::BinaryAuthorization;
|
||||
//! use binaryauthorization1::{BinaryAuthorization, oauth2, hyper, hyper_rustls};
|
||||
//!
|
||||
//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
|
||||
//! // `client_secret`, among other things.
|
||||
@@ -97,9 +92,9 @@
|
||||
//! // 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 = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
//! let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
//! secret,
|
||||
//! yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
//! oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
//! ).build().await.unwrap();
|
||||
//! let mut hub = BinaryAuthorization::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
//! // You can configure optional parameters by calling the respective setters at will, and
|
||||
@@ -195,10 +190,13 @@
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
|
||||
extern crate hyper;
|
||||
// Re-export the hyper and hyper_rustls crate, they are required to build the hub
|
||||
pub extern crate hyper;
|
||||
pub extern crate hyper_rustls;
|
||||
extern crate serde;
|
||||
extern crate serde_json;
|
||||
extern crate yup_oauth2 as oauth2;
|
||||
// Re-export the yup_oauth2 crate, that is required to call some methods of the hub and the client
|
||||
pub extern crate yup_oauth2 as oauth2;
|
||||
extern crate mime;
|
||||
extern crate url;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user