// This file is @generated by prost-build.
/// Assignment protocol for a license pool.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AssignmentProtocol {
    /// The type of assignment protocol.
    #[prost(oneof = "assignment_protocol::AssignmentType", tags = "2, 3")]
    pub assignment_type: ::core::option::Option<assignment_protocol::AssignmentType>,
}
/// Nested message and enum types in `AssignmentProtocol`.
pub mod assignment_protocol {
    /// Allow manual assignments triggered by administrative operations only.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct ManualAssignmentType {}
    /// Configuration for automatic assignments handled by data plane operations.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct AutoAssignmentType {
        /// Optional. The time to live for an inactive license. After this time has
        /// passed, the license will be automatically unassigned from the user. Must
        /// be at least 7 days, if set. If unset, the license will never expire.
        #[prost(message, optional, tag = "1")]
        pub inactive_license_ttl: ::core::option::Option<::prost_types::Duration>,
    }
    /// The type of assignment protocol.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum AssignmentType {
        /// Allow manual assignments triggered by administrative operations only.
        #[prost(message, tag = "2")]
        ManualAssignmentType(ManualAssignmentType),
        /// Allow automatic assignments triggered by data plane operations.
        #[prost(message, tag = "3")]
        AutoAssignmentType(AutoAssignmentType),
    }
}
/// A license pool represents a pool of licenses that can be assigned to users.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LicensePool {
    /// Identifier. Format:
    /// `billingAccounts/{billing_account}/orders/{order}/licensePool`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Required. Assignment protocol for the license pool.
    #[prost(message, optional, tag = "2")]
    pub license_assignment_protocol: ::core::option::Option<AssignmentProtocol>,
    /// Output only. Licenses count that are available to be assigned.
    #[prost(int32, tag = "3")]
    pub available_license_count: i32,
    /// Output only. Total number of licenses in the pool.
    #[prost(int32, tag = "4")]
    pub total_license_count: i32,
}
/// Request message for getting a license pool.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetLicensePoolRequest {
    /// Required. The name of the license pool to get.
    /// Format: `billingAccounts/{billing_account}/orders/{order}/licensePool`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request message for updating a license pool.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateLicensePoolRequest {
    /// Required. The license pool to update.
    ///
    /// The license pool's name field is used to identify the license pool to
    /// update. Format:
    /// `billingAccounts/{billing_account}/orders/{order}/licensePool`.
    #[prost(message, optional, tag = "1")]
    pub license_pool: ::core::option::Option<LicensePool>,
    /// Required. The list of fields to update.
    #[prost(message, optional, tag = "2")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// Request message for
/// \[LicenseManagementService.Assign\]\[google.cloud.commerce.consumer.procurement.v1.LicenseManagementService.Assign\].
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AssignRequest {
    /// Required. License pool name.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. Username.
    /// Format: `name@domain.com`.
    #[prost(string, repeated, tag = "2")]
    pub usernames: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Response message for
/// \[LicenseManagementService.Assign\]\[google.cloud.commerce.consumer.procurement.v1.LicenseManagementService.Assign\].
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AssignResponse {}
/// Request message for
/// \[LicenseManagementService.Unassign\]\[google.cloud.commerce.consumer.procurement.v1.LicenseManagementService.Unassign\].
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UnassignRequest {
    /// Required. License pool name.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. Username.
    /// Format: `name@domain.com`.
    #[prost(string, repeated, tag = "2")]
    pub usernames: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Response message for
/// \[LicenseManagementService.Unassign\]\[google.cloud.commerce.consumer.procurement.v1.LicenseManagementService.Unassign\].
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UnassignResponse {}
/// Request message for
/// \[LicenseManagementService.EnumerateLicensedUsers\]\[google.cloud.commerce.consumer.procurement.v1.LicenseManagementService.EnumerateLicensedUsers\].
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EnumerateLicensedUsersRequest {
    /// Required. License pool name.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Optional. The maximum number of users to return. The service may return
    /// fewer than this value.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// Optional. A page token, received from a previous `EnumerateLicensedUsers`
    /// call. Provide this to retrieve the subsequent page.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
}
/// A licensed user.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LicensedUser {
    /// Username.
    /// Format: `name@domain.com`.
    #[prost(string, tag = "1")]
    pub username: ::prost::alloc::string::String,
    /// Output only. Timestamp when the license was assigned.
    #[prost(message, optional, tag = "2")]
    pub assign_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. Timestamp when the license was recently used. This may not be
    /// the most recent usage time, and will be updated regularly (within 24
    /// hours).
    #[prost(message, optional, tag = "3")]
    pub recent_usage_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// Response message for
/// \[LicenseManagementService.EnumerateLicensedUsers\]\[google.cloud.commerce.consumer.procurement.v1.LicenseManagementService.EnumerateLicensedUsers\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EnumerateLicensedUsersResponse {
    /// The list of licensed users.
    #[prost(message, repeated, tag = "1")]
    pub licensed_users: ::prost::alloc::vec::Vec<LicensedUser>,
    /// A token that can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod license_management_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Service for managing licenses.
    #[derive(Debug, Clone)]
    pub struct LicenseManagementServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl LicenseManagementServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> LicenseManagementServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> LicenseManagementServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            LicenseManagementServiceClient::new(
                InterceptedService::new(inner, interceptor),
            )
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Gets the license pool.
        pub async fn get_license_pool(
            &mut self,
            request: impl tonic::IntoRequest<super::GetLicensePoolRequest>,
        ) -> std::result::Result<tonic::Response<super::LicensePool>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.commerce.consumer.procurement.v1.LicenseManagementService/GetLicensePool",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.commerce.consumer.procurement.v1.LicenseManagementService",
                        "GetLicensePool",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates the license pool if one exists for this Order.
        pub async fn update_license_pool(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateLicensePoolRequest>,
        ) -> std::result::Result<tonic::Response<super::LicensePool>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.commerce.consumer.procurement.v1.LicenseManagementService/UpdateLicensePool",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.commerce.consumer.procurement.v1.LicenseManagementService",
                        "UpdateLicensePool",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Assigns a license to a user.
        pub async fn assign(
            &mut self,
            request: impl tonic::IntoRequest<super::AssignRequest>,
        ) -> std::result::Result<tonic::Response<super::AssignResponse>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.commerce.consumer.procurement.v1.LicenseManagementService/Assign",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.commerce.consumer.procurement.v1.LicenseManagementService",
                        "Assign",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Unassigns a license from a user.
        pub async fn unassign(
            &mut self,
            request: impl tonic::IntoRequest<super::UnassignRequest>,
        ) -> std::result::Result<
            tonic::Response<super::UnassignResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.commerce.consumer.procurement.v1.LicenseManagementService/Unassign",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.commerce.consumer.procurement.v1.LicenseManagementService",
                        "Unassign",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Enumerates all users assigned a license.
        pub async fn enumerate_licensed_users(
            &mut self,
            request: impl tonic::IntoRequest<super::EnumerateLicensedUsersRequest>,
        ) -> std::result::Result<
            tonic::Response<super::EnumerateLicensedUsersResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.commerce.consumer.procurement.v1.LicenseManagementService/EnumerateLicensedUsers",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.commerce.consumer.procurement.v1.LicenseManagementService",
                        "EnumerateLicensedUsers",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Represents a purchase made by a customer on Cloud Marketplace.
/// Creating an order makes sure that both the Google backend systems
/// as well as external service provider's systems (if needed) allow use of
/// purchased products and ensures the appropriate billing events occur.
///
/// An Order can be made against one Product with multiple add-ons (optional) or
/// one Quote which might reference multiple products.
///
/// Customers typically choose a price plan for each Product purchased when
/// they create an order and can change their plan later, if the product allows.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Order {
    /// Output only. The resource name of the order.
    /// Has the form
    /// `billingAccounts/{billing_account}/orders/{order}`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Required. The user-specified name of the order.
    #[prost(string, tag = "10")]
    pub display_name: ::prost::alloc::string::String,
    /// Output only. The items being purchased.
    #[prost(message, repeated, tag = "6")]
    pub line_items: ::prost::alloc::vec::Vec<LineItem>,
    /// Output only. Line items that were cancelled.
    #[prost(message, repeated, tag = "7")]
    pub cancelled_line_items: ::prost::alloc::vec::Vec<LineItem>,
    /// Output only. The creation timestamp.
    #[prost(message, optional, tag = "8")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The last update timestamp.
    #[prost(message, optional, tag = "9")]
    pub update_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The weak etag of the order.
    #[prost(string, tag = "11")]
    pub etag: ::prost::alloc::string::String,
}
/// A single item within an order.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LineItem {
    /// Output only. Line item ID.
    #[prost(string, tag = "1")]
    pub line_item_id: ::prost::alloc::string::String,
    /// Output only. Current state and information of this item. It tells what,
    /// e.g. which offer, is currently effective.
    #[prost(message, optional, tag = "2")]
    pub line_item_info: ::core::option::Option<LineItemInfo>,
    /// Output only. A change made on the item which is pending and not yet
    /// effective. Absence of this field indicates the line item is not undergoing
    /// a change.
    #[prost(message, optional, tag = "3")]
    pub pending_change: ::core::option::Option<LineItemChange>,
    /// Output only. Changes made on the item that are not pending anymore which
    /// might be because they already took effect, were reverted by the customer,
    /// or were rejected by the partner. No more operations are allowed on these
    /// changes.
    #[prost(message, repeated, tag = "4")]
    pub change_history: ::prost::alloc::vec::Vec<LineItemChange>,
}
/// A change made on a line item.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LineItemChange {
    /// Output only. Change ID.
    /// All changes made within one order update operation have the same change_id.
    #[prost(string, tag = "1")]
    pub change_id: ::prost::alloc::string::String,
    /// Required. Type of the change to make.
    #[prost(enumeration = "LineItemChangeType", tag = "2")]
    pub change_type: i32,
    /// Output only. Line item info before the change.
    #[prost(message, optional, tag = "3")]
    pub old_line_item_info: ::core::option::Option<LineItemInfo>,
    /// Line item info after the change.
    #[prost(message, optional, tag = "4")]
    pub new_line_item_info: ::core::option::Option<LineItemInfo>,
    /// Output only. State of the change.
    #[prost(enumeration = "LineItemChangeState", tag = "5")]
    pub change_state: i32,
    /// Output only. Provider-supplied message explaining the LineItemChange's
    /// state. Mainly used to communicate progress and ETA for provisioning in the
    /// case of `PENDING_APPROVAL`, and to explain why the change request was
    /// denied or canceled in the case of `REJECTED` and `CANCELED` states.
    #[prost(string, tag = "6")]
    pub state_reason: ::prost::alloc::string::String,
    /// Output only. Predefined enum types for why this line item change is in
    /// current state. For example, a line item change's state could be
    /// `LINE_ITEM_CHANGE_STATE_COMPLETED` because of end-of-term expiration,
    /// immediate cancellation initiated by the user, or system-initiated
    /// cancellation.
    #[prost(enumeration = "LineItemChangeStateReasonType", tag = "10")]
    pub change_state_reason_type: i32,
    /// Output only. A time at which the change became or will become (in case of
    /// pending change) effective.
    #[prost(message, optional, tag = "7")]
    pub change_effective_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The time when change was initiated.
    #[prost(message, optional, tag = "8")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The time when change was updated, e.g. approved/rejected by
    /// partners or cancelled by the user.
    #[prost(message, optional, tag = "9")]
    pub update_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// Line item information.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LineItemInfo {
    /// Optional. The name of the offer can have either of these formats:
    /// 'billingAccounts/{billing_account}/offers/{offer}',
    /// or 'services/{service}/standardOffers/{offer}'.
    #[prost(string, tag = "13")]
    pub offer: ::prost::alloc::string::String,
    /// Optional. User-provided parameters.
    #[prost(message, repeated, tag = "9")]
    pub parameters: ::prost::alloc::vec::Vec<Parameter>,
    /// Output only. Information about the subscription created, if applicable.
    #[prost(message, optional, tag = "10")]
    pub subscription: ::core::option::Option<Subscription>,
}
/// User-provided Parameters.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Parameter {
    /// Name of the parameter.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Value of parameter.
    #[prost(message, optional, tag = "2")]
    pub value: ::core::option::Option<parameter::Value>,
}
/// Nested message and enum types in `Parameter`.
pub mod parameter {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Value {
        /// The kind of value.
        #[prost(oneof = "value::Kind", tags = "3, 4, 5")]
        pub kind: ::core::option::Option<value::Kind>,
    }
    /// Nested message and enum types in `Value`.
    pub mod value {
        /// The kind of value.
        #[derive(Clone, PartialEq, ::prost::Oneof)]
        pub enum Kind {
            /// Represents an int64 value.
            #[prost(int64, tag = "3")]
            Int64Value(i64),
            /// Represents a string value.
            #[prost(string, tag = "4")]
            StringValue(::prost::alloc::string::String),
            /// Represents a double value.
            #[prost(double, tag = "5")]
            DoubleValue(f64),
        }
    }
}
/// Subscription information.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Subscription {
    /// The timestamp when the subscription begins, if applicable.
    #[prost(message, optional, tag = "3")]
    pub start_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The timestamp when the subscription ends, if applicable.
    #[prost(message, optional, tag = "1")]
    pub end_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Whether auto renewal is enabled by user choice on current subscription.
    /// This field indicates order/subscription status after pending plan change is
    /// cancelled or rejected.
    #[prost(bool, tag = "2")]
    pub auto_renewal_enabled: bool,
}
/// Type of a line item change.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LineItemChangeType {
    /// Sentinel value. Do not use.
    Unspecified = 0,
    /// The change is to create a new line item.
    Create = 1,
    /// The change is to update an existing line item.
    Update = 2,
    /// The change is to cancel an existing line item.
    Cancel = 3,
    /// The change is to revert a cancellation.
    RevertCancellation = 4,
}
impl LineItemChangeType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "LINE_ITEM_CHANGE_TYPE_UNSPECIFIED",
            Self::Create => "LINE_ITEM_CHANGE_TYPE_CREATE",
            Self::Update => "LINE_ITEM_CHANGE_TYPE_UPDATE",
            Self::Cancel => "LINE_ITEM_CHANGE_TYPE_CANCEL",
            Self::RevertCancellation => "LINE_ITEM_CHANGE_TYPE_REVERT_CANCELLATION",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "LINE_ITEM_CHANGE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "LINE_ITEM_CHANGE_TYPE_CREATE" => Some(Self::Create),
            "LINE_ITEM_CHANGE_TYPE_UPDATE" => Some(Self::Update),
            "LINE_ITEM_CHANGE_TYPE_CANCEL" => Some(Self::Cancel),
            "LINE_ITEM_CHANGE_TYPE_REVERT_CANCELLATION" => Some(Self::RevertCancellation),
            _ => None,
        }
    }
}
/// State of a change.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LineItemChangeState {
    /// Sentinel value. Do not use.
    Unspecified = 0,
    /// Change is in this state when a change is initiated and waiting for partner
    /// approval. This state is only applicable for pending change.
    PendingApproval = 1,
    /// Change is in this state after it's approved by the partner or auto-approved
    /// but before it takes effect. The change can be overwritten or cancelled
    /// depending on the new line item info property (pending Private Offer change
    /// cannot be cancelled and can only be overwritten by another Private Offer).
    /// This state is only applicable for pending change.
    Approved = 2,
    /// Change is in this state after it's been activated. This state is only
    /// applicable for change in history.
    Completed = 3,
    /// Change is in this state if it was rejected by the partner. This state is
    /// only applicable for change in history.
    Rejected = 4,
    /// Change is in this state if it was abandoned by the user. This state is only
    /// applicable for change in history.
    Abandoned = 5,
    /// Change is in this state if it's currently being provisioned downstream. The
    /// change can't be overwritten or cancelled when it's in this state. This
    /// state is only applicable for pending change.
    Activating = 6,
}
impl LineItemChangeState {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "LINE_ITEM_CHANGE_STATE_UNSPECIFIED",
            Self::PendingApproval => "LINE_ITEM_CHANGE_STATE_PENDING_APPROVAL",
            Self::Approved => "LINE_ITEM_CHANGE_STATE_APPROVED",
            Self::Completed => "LINE_ITEM_CHANGE_STATE_COMPLETED",
            Self::Rejected => "LINE_ITEM_CHANGE_STATE_REJECTED",
            Self::Abandoned => "LINE_ITEM_CHANGE_STATE_ABANDONED",
            Self::Activating => "LINE_ITEM_CHANGE_STATE_ACTIVATING",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "LINE_ITEM_CHANGE_STATE_UNSPECIFIED" => Some(Self::Unspecified),
            "LINE_ITEM_CHANGE_STATE_PENDING_APPROVAL" => Some(Self::PendingApproval),
            "LINE_ITEM_CHANGE_STATE_APPROVED" => Some(Self::Approved),
            "LINE_ITEM_CHANGE_STATE_COMPLETED" => Some(Self::Completed),
            "LINE_ITEM_CHANGE_STATE_REJECTED" => Some(Self::Rejected),
            "LINE_ITEM_CHANGE_STATE_ABANDONED" => Some(Self::Abandoned),
            "LINE_ITEM_CHANGE_STATE_ACTIVATING" => Some(Self::Activating),
            _ => None,
        }
    }
}
/// Predefined types for line item change state reason.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LineItemChangeStateReasonType {
    /// Default value, indicating there's no predefined type for change state
    /// reason.
    Unspecified = 0,
    /// Change is in current state due to term expiration.
    Expired = 1,
    /// Change is in current state due to user-initiated cancellation.
    UserCancelled = 2,
    /// Change is in current state due to system-initiated cancellation.
    SystemCancelled = 3,
}
impl LineItemChangeStateReasonType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "LINE_ITEM_CHANGE_STATE_REASON_TYPE_UNSPECIFIED",
            Self::Expired => "LINE_ITEM_CHANGE_STATE_REASON_TYPE_EXPIRED",
            Self::UserCancelled => "LINE_ITEM_CHANGE_STATE_REASON_TYPE_USER_CANCELLED",
            Self::SystemCancelled => {
                "LINE_ITEM_CHANGE_STATE_REASON_TYPE_SYSTEM_CANCELLED"
            }
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "LINE_ITEM_CHANGE_STATE_REASON_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "LINE_ITEM_CHANGE_STATE_REASON_TYPE_EXPIRED" => Some(Self::Expired),
            "LINE_ITEM_CHANGE_STATE_REASON_TYPE_USER_CANCELLED" => {
                Some(Self::UserCancelled)
            }
            "LINE_ITEM_CHANGE_STATE_REASON_TYPE_SYSTEM_CANCELLED" => {
                Some(Self::SystemCancelled)
            }
            _ => None,
        }
    }
}
/// Request message for
/// \[ConsumerProcurementService.PlaceOrder\]\[google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService.PlaceOrder\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PlaceOrderRequest {
    /// Required. The resource name of the parent resource.
    /// This field has the form  `billingAccounts/{billing-account-id}`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The user-specified name of the order being placed.
    #[prost(string, tag = "6")]
    pub display_name: ::prost::alloc::string::String,
    /// Optional. Places order for offer. Required when an offer-based order is
    /// being placed.
    #[prost(message, repeated, tag = "10")]
    pub line_item_info: ::prost::alloc::vec::Vec<LineItemInfo>,
    /// Optional. A unique identifier for this request.
    /// The server will ignore subsequent requests that provide a duplicate request
    /// ID for at least 24 hours after the first request.
    ///
    /// The request ID must be a valid
    /// [UUID](<https://en.wikipedia.org/wiki/Universally_unique_identifier#Format>).
    #[prost(string, tag = "7")]
    pub request_id: ::prost::alloc::string::String,
}
/// Message stored in the metadata field of the Operation returned by
/// \[ConsumerProcurementService.PlaceOrder\]\[google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService.PlaceOrder\].
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PlaceOrderMetadata {}
/// Request message for
/// \[ConsumerProcurementService.GetOrder\]\[google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService.GetOrder\]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetOrderRequest {
    /// Required. The name of the order to retrieve.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request message for
/// \[ConsumerProcurementService.ListOrders\]\[google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService.ListOrders\].
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListOrdersRequest {
    /// Required. The parent resource to query for orders.
    /// This field has the form `billingAccounts/{billing-account-id}`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// The maximum number of entries requested.
    /// The default page size is 25 and the maximum page size is 200.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// The token for fetching the next page.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
    /// Filter that you can use to limit the list request.
    ///
    /// A query string that can match a selected set of attributes
    /// with string values. For example, `display_name=abc`.
    /// Supported query attributes are
    ///
    /// * `display_name`
    ///
    /// If the query contains special characters other than letters,
    /// underscore, or digits, the phrase must be quoted with double quotes. For
    /// example, `display_name="foo:bar"`, where the display name needs to be
    /// quoted because it contains special character colon.
    ///
    /// Queries can be combined with `OR`, and `NOT` to form more complex queries.
    /// You can also group them to force a desired evaluation order.
    /// For example, `display_name=abc OR display_name=def`.
    #[prost(string, tag = "4")]
    pub filter: ::prost::alloc::string::String,
}
/// Response message for
/// \[ConsumerProcurementService.ListOrders\]\[google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService.ListOrders\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOrdersResponse {
    /// The list of orders in this response.
    #[prost(message, repeated, tag = "1")]
    pub orders: ::prost::alloc::vec::Vec<Order>,
    /// The token for fetching the next page.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Request message for
/// \[ConsumerProcurementService.ModifyOrder\]\[google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService.ModifyOrder\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ModifyOrderRequest {
    /// Required. Name of the order to update.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. Modifications for an existing Order created by an Offer.
    /// Required when Offer based Order is being modified, except for when going
    /// from an offer to a public plan.
    #[prost(message, repeated, tag = "6")]
    pub modifications: ::prost::alloc::vec::Vec<modify_order_request::Modification>,
    /// Optional. Updated display name of the order, leave as empty if you do not
    /// want to update current display name.
    #[prost(string, tag = "5")]
    pub display_name: ::prost::alloc::string::String,
    /// Optional. The weak etag, which can be optionally populated, of the order
    /// that this modify request is based on. Validation checking will only happen
    /// if the invoker supplies this field.
    #[prost(string, tag = "4")]
    pub etag: ::prost::alloc::string::String,
}
/// Nested message and enum types in `ModifyOrderRequest`.
pub mod modify_order_request {
    /// Modifications to make on the order.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Modification {
        /// Required. ID of the existing line item to make change to.
        /// Required when change type is
        /// \[LineItemChangeType.LINE_ITEM_CHANGE_TYPE_UPDATE\] or
        /// \[LineItemChangeType.LINE_ITEM_CHANGE_TYPE_CANCEL\].
        #[prost(string, tag = "1")]
        pub line_item_id: ::prost::alloc::string::String,
        /// Required. Type of change to make.
        #[prost(enumeration = "super::LineItemChangeType", tag = "2")]
        pub change_type: i32,
        /// Optional. The line item to update to.
        /// Required when change_type is
        /// \[LineItemChangeType.LINE_ITEM_CHANGE_TYPE_CREATE\] or
        /// \[LineItemChangeType.LINE_ITEM_CHANGE_TYPE_UPDATE\].
        #[prost(message, optional, tag = "3")]
        pub new_line_item_info: ::core::option::Option<super::LineItemInfo>,
        /// Optional. Auto renewal behavior of the subscription for the update.
        /// Applied when change_type is
        /// \[LineItemChangeType.LINE_ITEM_CHANGE_TYPE_UPDATE\]. Follows plan default
        /// config when this field is not specified.
        #[prost(enumeration = "super::AutoRenewalBehavior", tag = "4")]
        pub auto_renewal_behavior: i32,
    }
}
/// Message stored in the metadata field of the Operation returned by
/// \[ConsumerProcurementService.ModifyOrder\]\[google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService.ModifyOrder\].
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ModifyOrderMetadata {}
/// Request message for
/// \[ConsumerProcurementService.CancelOrder\]\[google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService.CancelOrder\].
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CancelOrderRequest {
    /// Required. The resource name of the order.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. The weak etag, which can be optionally populated, of the order
    /// that this cancel request is based on. Validation checking will only happen
    /// if the invoker supplies this field.
    #[prost(string, tag = "2")]
    pub etag: ::prost::alloc::string::String,
    /// Optional. Cancellation policy of this request.
    #[prost(enumeration = "cancel_order_request::CancellationPolicy", tag = "3")]
    pub cancellation_policy: i32,
}
/// Nested message and enum types in `CancelOrderRequest`.
pub mod cancel_order_request {
    /// Indicates the cancellation policy the customer uses to cancel the order.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum CancellationPolicy {
        /// If unspecified, cancellation will try to cancel the order, if order
        /// cannot be immediately cancelled, auto renewal will be turned off.
        /// However, caller should avoid using the value as it will yield a
        /// non-deterministic result. This is still supported mainly to maintain
        /// existing integrated usages and ensure backwards compatibility.
        Unspecified = 0,
        /// Request will cancel the whole order immediately, if order cannot be
        /// immediately cancelled, the request will fail.
        CancelImmediately = 1,
        /// Request will cancel the auto renewal, if order is not subscription based,
        /// the request will fail.
        CancelAtTermEnd = 2,
    }
    impl CancellationPolicy {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "CANCELLATION_POLICY_UNSPECIFIED",
                Self::CancelImmediately => "CANCELLATION_POLICY_CANCEL_IMMEDIATELY",
                Self::CancelAtTermEnd => "CANCELLATION_POLICY_CANCEL_AT_TERM_END",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "CANCELLATION_POLICY_UNSPECIFIED" => Some(Self::Unspecified),
                "CANCELLATION_POLICY_CANCEL_IMMEDIATELY" => Some(Self::CancelImmediately),
                "CANCELLATION_POLICY_CANCEL_AT_TERM_END" => Some(Self::CancelAtTermEnd),
                _ => None,
            }
        }
    }
}
/// Message stored in the metadata field of the Operation returned by
/// \[ConsumerProcurementService.CancelOrder\]\[google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService.CancelOrder\].
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CancelOrderMetadata {}
/// Indicates the auto renewal behavior customer specifies on subscription.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AutoRenewalBehavior {
    /// If unspecified, the auto renewal behavior will follow the default config.
    Unspecified = 0,
    /// Auto Renewal will be enabled on subscription.
    Enable = 1,
    /// Auto Renewal will be disabled on subscription.
    Disable = 2,
}
impl AutoRenewalBehavior {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "AUTO_RENEWAL_BEHAVIOR_UNSPECIFIED",
            Self::Enable => "AUTO_RENEWAL_BEHAVIOR_ENABLE",
            Self::Disable => "AUTO_RENEWAL_BEHAVIOR_DISABLE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "AUTO_RENEWAL_BEHAVIOR_UNSPECIFIED" => Some(Self::Unspecified),
            "AUTO_RENEWAL_BEHAVIOR_ENABLE" => Some(Self::Enable),
            "AUTO_RENEWAL_BEHAVIOR_DISABLE" => Some(Self::Disable),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod consumer_procurement_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// ConsumerProcurementService allows customers to make purchases of products
    /// served by the Cloud Commerce platform.
    ///
    /// When purchases are made, the
    /// \[ConsumerProcurementService\]\[google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService\]
    /// programs the appropriate backends, including both Google's own
    /// infrastructure, as well as third-party systems, and to enable billing setup
    /// for charging for the procured item.
    #[derive(Debug, Clone)]
    pub struct ConsumerProcurementServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl ConsumerProcurementServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> ConsumerProcurementServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> ConsumerProcurementServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            ConsumerProcurementServiceClient::new(
                InterceptedService::new(inner, interceptor),
            )
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Creates a new \[Order\]\[google.cloud.commerce.consumer.procurement.v1.Order\].
        ///
        /// This API only supports GCP spend-based committed use
        /// discounts specified by GCP documentation.
        ///
        /// The returned long-running operation is in-progress until the backend
        /// completes the creation of the resource. Once completed, the order is
        /// in
        /// \[OrderState.ORDER_STATE_ACTIVE\]\[google.cloud.commerce.consumer.procurement.v1.OrderState.ORDER_STATE_ACTIVE\].
        /// In case of failure, the order resource will be removed.
        pub async fn place_order(
            &mut self,
            request: impl tonic::IntoRequest<super::PlaceOrderRequest>,
        ) -> std::result::Result<
            tonic::Response<
                super::super::super::super::super::super::longrunning::Operation,
            >,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService/PlaceOrder",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService",
                        "PlaceOrder",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Returns the requested
        /// \[Order\]\[google.cloud.commerce.consumer.procurement.v1.Order\] resource.
        pub async fn get_order(
            &mut self,
            request: impl tonic::IntoRequest<super::GetOrderRequest>,
        ) -> std::result::Result<tonic::Response<super::Order>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService/GetOrder",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService",
                        "GetOrder",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists \[Order\]\[google.cloud.commerce.consumer.procurement.v1.Order\]
        /// resources that the user has access to, within the scope of the parent
        /// resource.
        pub async fn list_orders(
            &mut self,
            request: impl tonic::IntoRequest<super::ListOrdersRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListOrdersResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService/ListOrders",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService",
                        "ListOrders",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Modifies an existing
        /// \[Order\]\[google.cloud.commerce.consumer.procurement.v1.Order\] resource.
        pub async fn modify_order(
            &mut self,
            request: impl tonic::IntoRequest<super::ModifyOrderRequest>,
        ) -> std::result::Result<
            tonic::Response<
                super::super::super::super::super::super::longrunning::Operation,
            >,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService/ModifyOrder",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService",
                        "ModifyOrder",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Cancels an existing
        /// \[Order\]\[google.cloud.commerce.consumer.procurement.v1.Order\]. Every product
        /// procured in the Order will be cancelled.
        pub async fn cancel_order(
            &mut self,
            request: impl tonic::IntoRequest<super::CancelOrderRequest>,
        ) -> std::result::Result<
            tonic::Response<
                super::super::super::super::super::super::longrunning::Operation,
            >,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService/CancelOrder",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService",
                        "CancelOrder",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
