// This file is @generated by prost-build.
/// Request message for the `CreateReport` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateReportRequest {
    /// Required. The parent Google Cloud project that will own the report.
    ///
    /// This value does not define the scope of the report data. See `Report.scope`
    /// for setting the data scope.
    ///
    /// Format: `projects/{project}/locations/{location}`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The ID to use for this report. This ID must be unique within
    /// the parent project and should comply with RFC 1034 restrictions (letters,
    /// numbers, and hyphen, with the first character a letter, the last a letter
    /// or a number, and a 63 character maximum).
    #[prost(string, tag = "2")]
    pub report_id: ::prost::alloc::string::String,
    /// Required. The report resource to create.
    #[prost(message, optional, tag = "3")]
    pub report: ::core::option::Option<Report>,
}
/// A configuration that defines the parameters for the data represented by a
/// report.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Report {
    /// Identifier. The name of this report.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Required. A list of dimensions to include in the report. Supported values:
    ///
    /// * `project`
    /// * `application`
    /// * `service_or_workload`
    /// * `resource`
    /// * `resource_type`
    /// * `location`
    /// * `product_display_name`
    /// * `sku`
    /// * `month`
    /// * `day`
    /// * `hour`
    ///
    /// To aggregate results by time, specify at least one time dimension
    /// (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
    /// respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
    ///
    /// * `month`: `YYYY-MM` (e.g., `2024-01`)
    /// * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
    /// * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
    ///
    /// If the time range filter does not align with the selected time dimension,
    /// the range is expanded to encompass the full period of the finest-grained
    /// time dimension.
    ///
    /// For example, if the filter is `2026-01-10` through `2026-01-12` and the
    /// `month` dimension is selected, the effective time range expands to include
    /// all of January (`2026-01-01` to `2026-02-01`).
    #[prost(string, repeated, tag = "2")]
    pub dimensions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Required. A list of metrics to include in the report. Supported values:
    ///
    /// * `cost`
    /// * `cpu_mean_utilization`
    /// * `cpu_usage_core_seconds`
    /// * `cpu_allocation_core_seconds`
    /// * `cpu_p95_utilization`
    /// * `memory_mean_utilization`
    /// * `memory_usage_byte_seconds`
    /// * `memory_allocation_byte_seconds`
    /// * `memory_p95_utilization`
    #[prost(string, repeated, tag = "7")]
    pub metrics: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Optional. The resource containers for which to fetch data. Default is the
    /// project specified in the report's parent.
    #[prost(message, repeated, tag = "3")]
    pub scopes: ::prost::alloc::vec::Vec<Scope>,
    /// Optional. A Common Expression Language (CEL) expression used to filter the
    /// data for the report.
    ///
    /// Predicates may refer to any dimension. Filtering must conform to these
    /// constraints:
    ///
    /// * All string field predicates must use exact string matches.
    /// * Multiple predicates referring to the same string field must be joined
    ///   using the logical OR operator ('||').
    /// * All other predicates must be joined using the logical AND operator
    ///   (`&&`).
    /// * A predicate on a time dimension (e.g., `day`) specifying the start time
    ///   must use a greater-than-or-equal-to comparison (`>=`).
    /// * A predicate on a time dimension specifying the end time must use a
    ///   less-than comparison (`<`).
    ///
    /// Examples:
    ///
    /// 1. Filter by a specific resource type:
    ///    `"resource_type == 'compute.googleapis.com/Instance'"`
    ///
    /// 1. Filter data points that fall within a specific absolute time interval:
    ///    `"hour >= timestamp('2024-01-01T00:00:00Z') && hour < timestamp('2024-02-01T00:00:00Z')"`
    ///
    /// 1. Filter data points that fall within the past 72 hours:
    ///    `"hour >= now - duration('72h')"`
    ///
    /// 1. Combine string predicate with time interval predicate:
    ///    `"(location == 'us-east1' || location == 'us-west1') &&  hour >= timestamp('2023-12-01T00:00:00Z') &&  hour < timestamp('2024-02-01T00:00:00Z')"`
    ///
    /// If the filter omits time dimensions (`month`, `day`, `hour`), the report
    /// defaults to a 7-day range ending at the previous Pacific Time midnight,
    /// with Daylight Saving Time (DST) applied.
    ///
    /// For example, if the current Pacific Time is `2026-01-05T12:00:00`,
    /// the default range is `2025-12-29T00:00:00` to `2026-01-05T00:00:00` Pacific
    /// time.
    #[prost(string, tag = "4")]
    pub filter: ::prost::alloc::string::String,
    /// Defines this report's expiration time.
    #[prost(oneof = "report::Expiration", tags = "6")]
    pub expiration: ::core::option::Option<report::Expiration>,
}
/// Nested message and enum types in `Report`.
pub mod report {
    /// Defines this report's expiration time.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Expiration {
        /// Output only. Timestamp in UTC of when this report expires. Once the
        /// report expires, it will no longer be accessible and the report's
        /// underlying data will be deleted.
        #[prost(message, tag = "6")]
        ExpireTime(::prost_types::Timestamp),
    }
}
/// Specifies the report scope.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Scope {
    #[prost(oneof = "scope::Scope", tags = "1, 2")]
    pub scope: ::core::option::Option<scope::Scope>,
}
/// Nested message and enum types in `Scope`.
pub mod scope {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Scope {
        /// Required. A Google Cloud Platform project to fetch data from.
        ///
        /// Format: `"projects/{project}"`.
        #[prost(string, tag = "1")]
        Project(::prost::alloc::string::String),
        /// Required. An App Hub Application to fetch data from.
        ///
        /// Format:
        /// `"projects/{project}/locations/{location}/applications/{application}"`.
        #[prost(string, tag = "2")]
        Application(::prost::alloc::string::String),
    }
}
/// Request message for the `GetReport` method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetReportRequest {
    /// Required. The name of the report to retrieve.
    ///
    /// Format: `projects/{project}/locations/{location}/reports/{report_id}`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request message for the `ListReports` method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListReportsRequest {
    /// Required. The parent project whose reports are to be listed.
    ///
    /// Format: `projects/{project}/locations/{location}`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Optional. The maximum number of reports to return. The service may return
    /// fewer than this value. If unspecified, the server will determine the number
    /// of results to return.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// Optional. A page token, received from a previous `ListReports` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to `ListReports` must match
    /// the call that provided the page token.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
}
/// Response message for the `ListReports` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListReportsResponse {
    /// The list of reports.
    #[prost(message, repeated, tag = "1")]
    pub reports: ::prost::alloc::vec::Vec<Report>,
    /// A token that can be sent as `page_token` to retrieve the next page.
    /// If this field is empty, there are no subsequent pages.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Request message for the `DeleteReport` method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteReportRequest {
    /// Required. The name of the report to delete.
    ///
    /// Format: `projects/{project}/locations/{location}/reports/{report_id}`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. If set to true, and the report is not found, the request will
    /// succeed but no action will be taken on the server.
    #[prost(bool, tag = "2")]
    pub allow_missing: bool,
}
/// Request message for the `ReadReport` method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadReportRequest {
    /// Required. The resource name of the report to query.
    ///
    /// Format: `projects/{project}/locations/{location}/reports/{report_id}`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. The maximum number of rows to return. The service may return
    /// fewer than this value. If unspecified, at most 10,000 rows will be returned
    /// per page. The maximum allowed value is 25,000; values above 25,000 are
    /// coerced to 25,000.
    #[prost(int32, tag = "4")]
    pub page_size: i32,
    /// Optional. A page token, received from a previous `ReadReport` call, to
    /// retrieve the subsequent page of results. When `page_token` is specified,
    /// `job_reference` must also be provided from the previous response, and the
    /// `statement` field must not be set.
    #[prost(string, tag = "5")]
    pub page_token: ::prost::alloc::string::String,
}
/// Response message for the `ReadReport` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadReportResponse {
    /// A list of rows, where each row represents a record from the report.
    #[prost(message, repeated, tag = "1")]
    pub rows: ::prost::alloc::vec::Vec<::prost_types::ListValue>,
    /// The columns describing the structure of the data in the `rows` field.
    #[prost(message, repeated, tag = "5")]
    pub columns: ::prost::alloc::vec::Vec<Column>,
    /// A token that can be sent as `page_token` in a subsequent `ReadReport`
    /// request to retrieve the next page of results. If this field is empty,
    /// there are no further pages.
    #[prost(string, tag = "3")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Describes a single column within `Columns`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Column {
    /// The name of the column.
    ///
    /// This field:
    ///
    /// * Contains only letters (a-z, A-Z), numbers (0-9), or underscores (\_);
    /// * Start with a letter or underscore; and
    /// * Has a maximum length is 128 characters.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// The data type of the column.
    ///
    /// Supported values include:
    ///
    /// * `STRING`
    /// * `INT64`
    /// * `FLOAT64`
    /// * `BOOLEAN`
    /// * `TIMESTAMP`
    /// * `RECORD`
    ///
    /// `RECORD` indicates that the field contains a nested schema, described in
    /// the `columns` property of this `Column`.
    #[prost(string, tag = "2")]
    pub r#type: ::prost::alloc::string::String,
    /// The mode of the column, indicating if it is nullable, required, or
    /// repeated.
    ///
    /// Possible values:
    ///
    /// * `NULLABLE`: The column allows NULL values.
    /// * `REQUIRED`: The column does not allow NULL values.
    /// * `REPEATED`: The column contains an array of values.
    #[prost(string, tag = "3")]
    pub mode: ::prost::alloc::string::String,
    /// If the `type` of this column is `RECORD`, this sub-field describes the
    /// nested structure.
    #[prost(message, repeated, tag = "4")]
    pub columns: ::prost::alloc::vec::Vec<Column>,
}
/// Represents metadata related to the creation of a Report. This value is
/// embedded in the Operation object returned by `CreateReport`.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct OperationMetadata {}
/// Generated client implementations.
pub mod app_optimize_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 and querying optimization reports.
    #[derive(Debug, Clone)]
    pub struct AppOptimizeClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl AppOptimizeClient<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> AppOptimizeClient<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,
        ) -> AppOptimizeClient<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,
        {
            AppOptimizeClient::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 report.
        ///
        /// This initiates a long-running operation that, upon completion, results
        /// in a report resource. Once the report is created, its results can be read
        /// via `ReadReport`.
        pub async fn create_report(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateReportRequest>,
        ) -> std::result::Result<
            tonic::Response<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.appoptimize.v1beta.AppOptimize/CreateReport",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.appoptimize.v1beta.AppOptimize",
                        "CreateReport",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Retrieves the details of a report configuration.
        pub async fn get_report(
            &mut self,
            request: impl tonic::IntoRequest<super::GetReportRequest>,
        ) -> std::result::Result<tonic::Response<super::Report>, 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.appoptimize.v1beta.AppOptimize/GetReport",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.appoptimize.v1beta.AppOptimize",
                        "GetReport",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists reports within a given project.
        pub async fn list_reports(
            &mut self,
            request: impl tonic::IntoRequest<super::ListReportsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListReportsResponse>,
            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.appoptimize.v1beta.AppOptimize/ListReports",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.appoptimize.v1beta.AppOptimize",
                        "ListReports",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes the specified report.
        pub async fn delete_report(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteReportRequest>,
        ) -> std::result::Result<tonic::Response<()>, 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.appoptimize.v1beta.AppOptimize/DeleteReport",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.appoptimize.v1beta.AppOptimize",
                        "DeleteReport",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Reads data within a specified report.
        pub async fn read_report(
            &mut self,
            request: impl tonic::IntoRequest<super::ReadReportRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ReadReportResponse>,
            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.appoptimize.v1beta.AppOptimize/ReadReport",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.appoptimize.v1beta.AppOptimize",
                        "ReadReport",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
