// This file is @generated by prost-build.
/// Defines the destination Pub/Sub subscription.
/// If none of `push_config`, `bigquery_config`, `cloud_storage_config`,
/// `pubsub_export_config`, or `pubsublite_export_config`
/// is set, then the subscriber will pull and ack messages using API methods. At
/// most one of these fields may be set.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PubSubSubscription {
    /// Required. Name of the subscription.
    /// Format is `projects/{project}/subscriptions/{sub}`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. If push delivery is used with this subscription, this field is
    /// used to configure it.
    #[prost(message, optional, tag = "4")]
    pub push_config: ::core::option::Option<PushConfig>,
    /// Optional. If delivery to BigQuery is used with this subscription, this
    /// field is used to configure it.
    #[prost(message, optional, tag = "18")]
    pub bigquery_config: ::core::option::Option<BigQueryConfig>,
    /// Optional. If delivery to Google Cloud Storage is used with this
    /// subscription, this field is used to configure it.
    #[prost(message, optional, tag = "22")]
    pub cloud_storage_config: ::core::option::Option<CloudStorageConfig>,
    /// Optional. The approximate amount of time (on a best-effort basis) Pub/Sub
    /// waits for the subscriber to acknowledge receipt before resending the
    /// message. In the interval after the message is delivered and before it is
    /// acknowledged, it is considered to be *outstanding*. During that time
    /// period, the message will not be redelivered (on a best-effort basis).
    ///
    /// For pull subscriptions, this value is used as the initial value for the ack
    /// deadline. To override this value for a given message, call
    /// `ModifyAckDeadline` with the corresponding `ack_id` if using
    /// non-streaming pull or send the `ack_id` in a
    /// `StreamingModifyAckDeadlineRequest` if using streaming pull.
    /// The minimum custom deadline you can specify is 10 seconds.
    /// The maximum custom deadline you can specify is 600 seconds (10 minutes).
    /// If this parameter is 0, a default value of 10 seconds is used.
    ///
    /// For push delivery, this value is also used to set the request timeout for
    /// the call to the push endpoint.
    ///
    /// If the subscriber never acknowledges the message, the Pub/Sub
    /// system will eventually redeliver the message.
    #[prost(int32, tag = "5")]
    pub ack_deadline_seconds: i32,
    /// Optional. Indicates whether to retain acknowledged messages. If true, then
    /// messages are not expunged from the subscription's backlog, even if they are
    /// acknowledged, until they fall out of the `message_retention_duration`
    /// window. This must be true if you would like to \[`Seek` to a timestamp\]
    /// (<https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time>) in
    /// the past to replay previously-acknowledged messages.
    #[prost(bool, tag = "7")]
    pub retain_acked_messages: bool,
    /// Optional. How long to retain unacknowledged messages in the subscription's
    /// backlog, from the moment a message is published. If `retain_acked_messages`
    /// is true, then this also configures the retention of acknowledged messages,
    /// and thus configures how far back in time a `Seek` can be done. Defaults to
    /// 7 days. Cannot be more than 31 days or less than 10 minutes.
    #[prost(message, optional, tag = "8")]
    pub message_retention_duration: ::core::option::Option<::prost_types::Duration>,
    /// Optional. See [Creating and managing
    /// labels](<https://cloud.google.com/pubsub/docs/labels>).
    #[prost(map = "string, string", tag = "9")]
    pub labels: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// Optional. If true, messages published with the same `ordering_key` in
    /// `PubsubMessage` will be delivered to the subscribers in the order in which
    /// they are received by the Pub/Sub system. Otherwise, they may be delivered
    /// in any order.
    #[prost(bool, tag = "10")]
    pub enable_message_ordering: bool,
    /// Optional. A policy that specifies the conditions for this subscription's
    /// expiration. A subscription is considered active as long as any connected
    /// subscriber is successfully consuming messages from the subscription or is
    /// issuing operations on the subscription. If `expiration_policy` is not set,
    /// a *default policy* with `ttl` of 31 days will be used. The minimum allowed
    /// value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
    /// but `expiration_policy.ttl` is not set, the subscription never expires.
    #[prost(message, optional, tag = "11")]
    pub expiration_policy: ::core::option::Option<ExpirationPolicy>,
    /// Optional. An expression written in the Pub/Sub [filter
    /// language](<https://cloud.google.com/pubsub/docs/filtering>). If non-empty,
    /// then only `PubsubMessage`s whose `attributes` field matches the filter are
    /// delivered on this subscription. If empty, then no messages are filtered
    /// out.
    #[prost(string, tag = "12")]
    pub filter: ::prost::alloc::string::String,
    /// Optional. A policy that specifies the conditions for dead lettering
    /// messages in this subscription. If dead_letter_policy is not set, dead
    /// lettering is disabled.
    ///
    /// The Pub/Sub service account associated with this subscriptions's
    /// parent project (i.e.,
    /// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
    /// permission to Acknowledge() messages on this subscription.
    #[prost(message, optional, tag = "13")]
    pub dead_letter_policy: ::core::option::Option<DeadLetterPolicy>,
    /// Optional. A policy that specifies how Pub/Sub retries message delivery for
    /// this subscription.
    ///
    /// If not set, the default retry policy is applied. This generally implies
    /// that messages will be retried as soon as possible for healthy subscribers.
    /// RetryPolicy will be triggered on NACKs or acknowledgement deadline
    /// exceeded events for a given message.
    #[prost(message, optional, tag = "14")]
    pub retry_policy: ::core::option::Option<RetryPolicy>,
    /// Optional. Indicates whether the subscription is detached from its topic.
    /// Detached subscriptions don't receive messages from their topic and don't
    /// retain any backlog. `Pull` and `StreamingPull` requests will return
    /// FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
    /// the endpoint will not be made.
    #[prost(bool, tag = "15")]
    pub detached: bool,
    /// Optional. If true, Pub/Sub provides the following guarantees for the
    /// delivery of a message with a given value of `message_id` on this
    /// subscription:
    ///
    /// * The message sent to a subscriber is guaranteed not to be resent
    ///   before the message's acknowledgement deadline expires.
    /// * An acknowledged message will not be resent to a subscriber.
    ///
    /// Note that subscribers may still receive multiple copies of a message
    /// when `enable_exactly_once_delivery` is true if the message was published
    /// multiple times by a publisher client. These copies are  considered distinct
    /// by Pub/Sub and have distinct `message_id` values.
    #[prost(bool, tag = "16")]
    pub enable_exactly_once_delivery: bool,
    /// Optional. Transforms to be applied to messages before they are delivered to
    /// subscribers. Transforms are applied in the order specified.
    #[prost(message, repeated, tag = "25")]
    pub message_transforms: ::prost::alloc::vec::Vec<MessageTransform>,
    /// Optional. Input only. Immutable. Tag keys/values directly bound to this
    /// resource. For example:
    /// "123/environment": "production",
    /// "123/costCenter": "marketing"
    #[prost(map = "string, string", tag = "26")]
    pub tags: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
/// A policy that specifies how Pub/Sub retries message delivery.
///
/// Retry delay will be exponential based on provided minimum and maximum
/// backoffs. <https://en.wikipedia.org/wiki/Exponential_backoff.>
///
/// RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded
/// events for a given message.
///
/// Retry Policy is implemented on a best effort basis. At times, the delay
/// between consecutive deliveries may not match the configuration. That is,
/// delay can be more or less than configured backoff.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RetryPolicy {
    /// Optional. The minimum delay between consecutive deliveries of a given
    /// message. Value should be between 0 and 600 seconds. Defaults to 10 seconds.
    #[prost(message, optional, tag = "1")]
    pub minimum_backoff: ::core::option::Option<::prost_types::Duration>,
    /// Optional. The maximum delay between consecutive deliveries of a given
    /// message. Value should be between 0 and 600 seconds. Defaults to 600
    /// seconds.
    #[prost(message, optional, tag = "2")]
    pub maximum_backoff: ::core::option::Option<::prost_types::Duration>,
}
/// Dead lettering is done on a best effort basis. The same message might be
/// dead lettered multiple times.
///
/// If validation on any of the fields fails at subscription creation/updation,
/// the create/update subscription request will fail.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeadLetterPolicy {
    /// Optional. The name of the topic to which dead letter messages should be
    /// published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub
    /// service account associated with the enclosing subscription's parent project
    /// (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must
    /// have permission to Publish() to this topic.
    ///
    /// The operation will fail if the topic does not exist.
    /// Users should ensure that there is a subscription attached to this topic
    /// since messages published to a topic with no subscriptions are lost.
    #[prost(string, tag = "1")]
    pub dead_letter_topic: ::prost::alloc::string::String,
    /// Optional. The maximum number of delivery attempts for any message. The
    /// value must be between 5 and 100.
    ///
    /// The number of delivery attempts is defined as 1 + (the sum of number of
    /// NACKs and number of times the acknowledgement deadline has been exceeded
    /// for the message).
    ///
    /// A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
    /// client libraries may automatically extend ack_deadlines.
    ///
    /// This field will be honored on a best effort basis.
    ///
    /// If this parameter is 0, a default value of 5 is used.
    #[prost(int32, tag = "2")]
    pub max_delivery_attempts: i32,
}
/// A policy that specifies the conditions for resource expiration (i.e.,
/// automatic resource deletion).
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExpirationPolicy {
    /// Optional. Specifies the "time-to-live" duration for an associated resource.
    /// The resource expires if it is not active for a period of `ttl`. The
    /// definition of "activity" depends on the type of the associated resource.
    /// The minimum and maximum allowed values for `ttl` depend on the type of the
    /// associated resource, as well. If `ttl` is not set, the associated resource
    /// never expires.
    #[prost(message, optional, tag = "1")]
    pub ttl: ::core::option::Option<::prost_types::Duration>,
}
/// Configuration for a push delivery endpoint.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PushConfig {
    /// Optional. A URL locating the endpoint to which messages should be pushed.
    /// For example, a Webhook endpoint might use `<https://example.com/push`.>
    #[prost(string, tag = "1")]
    pub push_endpoint: ::prost::alloc::string::String,
    /// Optional. Endpoint configuration attributes that can be used to control
    /// different aspects of the message delivery.
    ///
    /// The only currently supported attribute is `x-goog-version`, which you can
    /// use to change the format of the pushed message. This attribute
    /// indicates the version of the data expected by the endpoint. This
    /// controls the shape of the pushed message (i.e., its fields and metadata).
    ///
    /// If not present during the `CreateSubscription` call, it will default to
    /// the version of the Pub/Sub API used to make such call. If not present in a
    /// `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
    /// calls will always return a valid version, even if the subscription was
    /// created without this attribute.
    ///
    /// The only supported values for the `x-goog-version` attribute are:
    ///
    /// * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
    /// * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
    ///
    /// For example:
    /// `attributes { "x-goog-version": "v1" }`
    #[prost(map = "string, string", tag = "2")]
    pub attributes: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// An authentication method used by push endpoints to verify the source of
    /// push requests. This can be used with push endpoints that are private by
    /// default to allow requests only from the Pub/Sub system, for example.
    /// This field is optional and should be set only by users interested in
    /// authenticated push.
    #[prost(oneof = "push_config::AuthenticationMethod", tags = "3")]
    pub authentication_method: ::core::option::Option<push_config::AuthenticationMethod>,
    /// The format of the delivered message to the push endpoint is defined by
    /// the chosen wrapper. When unset, `PubsubWrapper` is used.
    #[prost(oneof = "push_config::Wrapper", tags = "4, 5")]
    pub wrapper: ::core::option::Option<push_config::Wrapper>,
}
/// Nested message and enum types in `PushConfig`.
pub mod push_config {
    /// Contains information needed for generating an
    /// [OpenID Connect
    /// token](<https://developers.google.com/identity/protocols/OpenIDConnect>).
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct OidcToken {
        /// Optional. [Service account
        /// email](<https://cloud.google.com/iam/docs/service-accounts>)
        /// used for generating the OIDC token. For more information
        /// on setting up authentication, see
        /// [Push subscriptions](<https://cloud.google.com/pubsub/docs/push>).
        #[prost(string, tag = "1")]
        pub service_account_email: ::prost::alloc::string::String,
        /// Optional. Audience to be used when generating OIDC token. The audience
        /// claim identifies the recipients that the JWT is intended for. The
        /// audience value is a single case-sensitive string. Having multiple values
        /// (array) for the audience field is not supported. More info about the OIDC
        /// JWT token audience here:
        /// <https://tools.ietf.org/html/rfc7519#section-4.1.3> Note: if not specified,
        /// the Push endpoint URL will be used.
        #[prost(string, tag = "2")]
        pub audience: ::prost::alloc::string::String,
    }
    /// The payload to the push endpoint is in the form of the JSON representation
    /// of a PubsubMessage
    /// (<https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage>).
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct PubsubWrapper {}
    /// Sets the `data` field as the HTTP body for delivery.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct NoWrapper {
        /// Optional. When true, writes the Pub/Sub message metadata to
        /// `x-goog-pubsub-<KEY>:<VAL>` headers of the HTTP request. Writes the
        /// Pub/Sub message attributes to `<KEY>:<VAL>` headers of the HTTP request.
        #[prost(bool, tag = "1")]
        pub write_metadata: bool,
    }
    /// An authentication method used by push endpoints to verify the source of
    /// push requests. This can be used with push endpoints that are private by
    /// default to allow requests only from the Pub/Sub system, for example.
    /// This field is optional and should be set only by users interested in
    /// authenticated push.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum AuthenticationMethod {
        /// Optional. If specified, Pub/Sub will generate and attach an OIDC JWT
        /// token as an `Authorization` header in the HTTP request for every pushed
        /// message.
        #[prost(message, tag = "3")]
        OidcToken(OidcToken),
    }
    /// The format of the delivered message to the push endpoint is defined by
    /// the chosen wrapper. When unset, `PubsubWrapper` is used.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Wrapper {
        /// Optional. When set, the payload to the push endpoint is in the form of
        /// the JSON representation of a PubsubMessage
        /// (<https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage>).
        #[prost(message, tag = "4")]
        PubsubWrapper(PubsubWrapper),
        /// Optional. When set, the payload to the push endpoint is not wrapped.
        #[prost(message, tag = "5")]
        NoWrapper(NoWrapper),
    }
}
/// Configuration for a BigQuery subscription.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BigQueryConfig {
    /// Optional. The name of the table to which to write data, of the form
    /// {projectId}.{datasetId}.{tableId}
    #[prost(string, tag = "1")]
    pub table: ::prost::alloc::string::String,
    /// Optional. When true, use the topic's schema as the columns to write to in
    /// BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
    /// enabled at the same time.
    #[prost(bool, tag = "2")]
    pub use_topic_schema: bool,
    /// Optional. When true, write the subscription name, message_id, publish_time,
    /// attributes, and ordering_key to additional columns in the table. The
    /// subscription name, message_id, and publish_time fields are put in their own
    /// columns while all other message properties (other than data) are written to
    /// a JSON object in the attributes column.
    #[prost(bool, tag = "3")]
    pub write_metadata: bool,
    /// Optional. When true and use_topic_schema is true, any fields that are a
    /// part of the topic schema that are not part of the BigQuery table schema are
    /// dropped when writing to BigQuery. Otherwise, the schemas must be kept in
    /// sync and any messages with extra fields are not written and remain in the
    /// subscription's backlog.
    #[prost(bool, tag = "4")]
    pub drop_unknown_fields: bool,
    /// Optional. When true, use the BigQuery table's schema as the columns to
    /// write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
    /// enabled at the same time.
    #[prost(bool, tag = "6")]
    pub use_table_schema: bool,
    /// Optional. The service account to use to write to BigQuery. The subscription
    /// creator or updater that specifies this field must have
    /// `iam.serviceAccounts.actAs` permission on the service account. If not
    /// specified, the Pub/Sub [service
    /// agent](<https://cloud.google.com/iam/docs/service-agents>),
    /// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
    #[prost(string, tag = "7")]
    pub service_account_email: ::prost::alloc::string::String,
}
/// Configuration for a Cloud Storage subscription.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CloudStorageConfig {
    /// Required. User-provided name for the Cloud Storage bucket.
    /// The bucket must be created by the user. The bucket name must be without
    /// any prefix like "gs://". See the \[bucket naming
    /// requirements\] (<https://cloud.google.com/storage/docs/buckets#naming>).
    #[prost(string, tag = "1")]
    pub bucket: ::prost::alloc::string::String,
    /// Optional. User-provided prefix for Cloud Storage filename. See the [object
    /// naming requirements](<https://cloud.google.com/storage/docs/objects#naming>).
    #[prost(string, tag = "2")]
    pub filename_prefix: ::prost::alloc::string::String,
    /// Optional. User-provided suffix for Cloud Storage filename. See the [object
    /// naming requirements](<https://cloud.google.com/storage/docs/objects#naming>).
    /// Must not end in "/".
    #[prost(string, tag = "3")]
    pub filename_suffix: ::prost::alloc::string::String,
    /// Optional. User-provided format string specifying how to represent datetimes
    /// in Cloud Storage filenames. See the [datetime format
    /// guidance](<https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names>).
    #[prost(string, tag = "10")]
    pub filename_datetime_format: ::prost::alloc::string::String,
    /// Optional. File batching settings.
    /// If no max_duration setting is specified, a max_duration of 5 minutes will
    /// be set by default. max_duration is required regardless of whether other
    /// file batching settings are specified.
    ///
    /// The maximum duration that can elapse before a new Cloud Storage file is
    /// created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
    /// the subscription's acknowledgement deadline.
    #[prost(message, optional, tag = "6")]
    pub max_duration: ::core::option::Option<::prost_types::Duration>,
    /// Optional. The maximum bytes that can be written to a Cloud Storage file
    /// before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may
    /// be exceeded in cases where messages are larger than the limit.
    #[prost(int64, tag = "7")]
    pub max_bytes: i64,
    /// Optional. The maximum number of messages that can be written to a Cloud
    /// Storage file before a new file is created. Min 1000 messages.
    #[prost(int64, tag = "8")]
    pub max_messages: i64,
    /// Optional. The service account to use to write to Cloud Storage. The
    /// subscription creator or updater that specifies this field must have
    /// `iam.serviceAccounts.actAs` permission on the service account. If not
    /// specified, the Pub/Sub
    /// [service agent](<https://cloud.google.com/iam/docs/service-agents>),
    /// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
    #[prost(string, tag = "11")]
    pub service_account_email: ::prost::alloc::string::String,
    /// Defaults to text format.
    #[prost(oneof = "cloud_storage_config::OutputFormat", tags = "4, 5")]
    pub output_format: ::core::option::Option<cloud_storage_config::OutputFormat>,
}
/// Nested message and enum types in `CloudStorageConfig`.
pub mod cloud_storage_config {
    /// Configuration for writing message data in text format.
    /// Message payloads will be written to files as raw text, separated by a
    /// newline.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct TextConfig {}
    /// Configuration for writing message data in Avro format.
    /// Message payloads and metadata will be written to files as an Avro binary.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct AvroConfig {
        /// Optional. When true, write the subscription name, message_id,
        /// publish_time, attributes, and ordering_key as additional fields in the
        /// output. The subscription name, message_id, and publish_time fields are
        /// put in their own fields while all other message properties other than
        /// data (for example, an ordering_key, if present) are added as entries in
        /// the attributes map.
        #[prost(bool, tag = "1")]
        pub write_metadata: bool,
        /// Optional. When true, the output Cloud Storage file will be serialized
        /// using the topic schema, if it exists.
        #[prost(bool, tag = "2")]
        pub use_topic_schema: bool,
    }
    /// Defaults to text format.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum OutputFormat {
        /// Optional. If set, message data will be written to Cloud Storage in text
        /// format.
        #[prost(message, tag = "4")]
        TextConfig(TextConfig),
        /// Optional. If set, message data will be written to Cloud Storage in Avro
        /// format.
        #[prost(message, tag = "5")]
        AvroConfig(AvroConfig),
    }
}
/// All supported message transforms types.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MessageTransform {
    /// Optional. This field is deprecated, use the `disabled` field to disable
    /// transforms.
    #[deprecated]
    #[prost(bool, tag = "3")]
    pub enabled: bool,
    /// Optional. If true, the transform is disabled and will not be applied to
    /// messages. Defaults to `false`.
    #[prost(bool, tag = "4")]
    pub disabled: bool,
    /// The type of transform to apply to messages.
    #[prost(oneof = "message_transform::Transform", tags = "2")]
    pub transform: ::core::option::Option<message_transform::Transform>,
}
/// Nested message and enum types in `MessageTransform`.
pub mod message_transform {
    /// The type of transform to apply to messages.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Transform {
        /// Optional. JavaScript User Defined Function. If multiple JavaScriptUDF's
        /// are specified on a resource, each must have a unique `function_name`.
        #[prost(message, tag = "2")]
        JavascriptUdf(super::JavaScriptUdf),
    }
}
/// User-defined JavaScript function that can transform or filter a Pub/Sub
/// message.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JavaScriptUdf {
    /// Required. Name of the JavasScript function that should applied to Pub/Sub
    /// messages.
    #[prost(string, tag = "1")]
    pub function_name: ::prost::alloc::string::String,
    /// Required. JavaScript code that contains a function `function_name` with the
    /// below signature:
    ///
    /// ```text,
    ///   /**
    ///   * Transforms a Pub/Sub message.
    ///
    ///   * @return {(Object<string, (string | Object<string, string>)>|null)} - To
    ///   * filter a message, return `null`. To transform a message return a map
    ///   * with the following keys:
    ///   *   - (required) 'data' : {string}
    ///   *   - (optional) 'attributes' : {Object<string, string>}
    ///   * Returning empty `attributes` will remove all attributes from the
    ///   * message.
    ///   *
    ///   * @param  {(Object<string, (string | Object<string, string>)>} Pub/Sub
    ///   * message. Keys:
    ///   *   - (required) 'data' : {string}
    ///   *   - (required) 'attributes' : {Object<string, string>}
    ///   *
    ///   * @param  {Object<string, any>} metadata - Pub/Sub message metadata.
    ///   * Keys:
    ///   *   - (required) 'message_id'  : {string}
    ///   *   - (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
    ///   *   - (optional) 'ordering_key': {string}
    ///   */
    ///
    ///   function <function_name>(message, metadata) {
    ///   }
    /// ```
    #[prost(string, tag = "2")]
    pub code: ::prost::alloc::string::String,
}
/// A data exchange is a container that lets you share data. Along with the
/// descriptive information about the data exchange, it contains listings that
/// reference shared datasets.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DataExchange {
    /// Output only. The resource name of the data exchange.
    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Required. Human-readable display name of the data exchange. The display
    /// name must contain only Unicode letters, numbers (0-9), underscores (\_),
    /// dashes (-), spaces ( ), ampersands (&) and must not start or end with
    /// spaces. Default value is an empty string. Max length: 63 bytes.
    #[prost(string, tag = "2")]
    pub display_name: ::prost::alloc::string::String,
    /// Optional. Description of the data exchange. The description must not
    /// contain Unicode non-characters as well as C0 and C1 control codes except
    /// tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF).
    /// Default value is an empty string.
    /// Max length: 2000 bytes.
    #[prost(string, tag = "3")]
    pub description: ::prost::alloc::string::String,
    /// Optional. Email or URL of the primary point of contact of the data
    /// exchange. Max Length: 1000 bytes.
    #[prost(string, tag = "4")]
    pub primary_contact: ::prost::alloc::string::String,
    /// Optional. Documentation describing the data exchange.
    #[prost(string, tag = "5")]
    pub documentation: ::prost::alloc::string::String,
    /// Output only. Number of listings contained in the data exchange.
    #[prost(int32, tag = "6")]
    pub listing_count: i32,
    /// Optional. Base64 encoded image representing the data exchange. Max
    /// Size: 3.0MiB Expected image dimensions are 512x512 pixels, however the API
    /// only performs validation on size of the encoded data. Note: For byte
    /// fields, the content of the fields are base64-encoded (which increases the
    /// size of the data by 33-36%) when using JSON on the wire.
    #[prost(bytes = "vec", tag = "7")]
    pub icon: ::prost::alloc::vec::Vec<u8>,
    /// Optional. Configurable data sharing environment option for a data exchange.
    #[prost(message, optional, tag = "8")]
    pub sharing_environment_config: ::core::option::Option<SharingEnvironmentConfig>,
    /// Optional. Type of discovery on the discovery page for all the listings
    /// under this exchange. Updating this field also updates (overwrites) the
    /// discovery_type field for all the listings under this exchange.
    #[prost(enumeration = "DiscoveryType", optional, tag = "9")]
    pub discovery_type: ::core::option::Option<i32>,
    /// Optional. By default, false.
    /// If true, the DataExchange has an email sharing mandate enabled.
    #[prost(bool, optional, tag = "10")]
    pub log_linked_dataset_query_user_email: ::core::option::Option<bool>,
}
/// A query template is a container for sharing table-valued functions defined by
/// contributors in a data clean room.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueryTemplate {
    /// Output only. The resource name of the QueryTemplate.
    /// e.g. `projects/myproject/locations/us/dataExchanges/123/queryTemplates/456`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Required. Human-readable display name of the QueryTemplate. The display
    /// name must contain only Unicode letters, numbers (0-9), underscores (\_),
    /// dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces.
    /// Default value is an empty string. Max length: 63 bytes.
    #[prost(string, tag = "2")]
    pub display_name: ::prost::alloc::string::String,
    /// Optional. Short description of the QueryTemplate. The description must not
    /// contain Unicode non-characters and C0 and C1 control codes except tabs
    /// (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default
    /// value is an empty string. Max length: 2000 bytes.
    #[prost(string, tag = "3")]
    pub description: ::prost::alloc::string::String,
    /// Optional. Will be deprecated.
    /// Email or URL of the primary point of contact of the QueryTemplate.
    /// Max Length: 1000 bytes.
    #[prost(string, tag = "4")]
    pub proposer: ::prost::alloc::string::String,
    /// Optional. Email or URL of the primary point of contact of the
    /// QueryTemplate. Max Length: 1000 bytes.
    #[prost(string, tag = "10")]
    pub primary_contact: ::prost::alloc::string::String,
    /// Optional. Documentation describing the QueryTemplate.
    #[prost(string, tag = "5")]
    pub documentation: ::prost::alloc::string::String,
    /// Output only. The QueryTemplate lifecycle state.
    #[prost(enumeration = "query_template::State", tag = "6")]
    pub state: i32,
    /// Optional. The routine associated with the QueryTemplate.
    #[prost(message, optional, tag = "7")]
    pub routine: ::core::option::Option<Routine>,
    /// Output only. Timestamp when the QueryTemplate was created.
    #[prost(message, optional, tag = "8")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. Timestamp when the QueryTemplate was last modified.
    #[prost(message, optional, tag = "9")]
    pub update_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// Nested message and enum types in `QueryTemplate`.
pub mod query_template {
    /// The QueryTemplate lifecycle state.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum State {
        /// Default value. This value is unused.
        Unspecified = 0,
        /// The QueryTemplate is in draft state.
        Drafted = 1,
        /// The QueryTemplate is in pending state.
        Pending = 2,
        /// The QueryTemplate is in deleted state.
        Deleted = 3,
        /// The QueryTemplate is in approved state.
        Approved = 4,
    }
    impl State {
        /// 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 => "STATE_UNSPECIFIED",
                Self::Drafted => "DRAFTED",
                Self::Pending => "PENDING",
                Self::Deleted => "DELETED",
                Self::Approved => "APPROVED",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "DRAFTED" => Some(Self::Drafted),
                "PENDING" => Some(Self::Pending),
                "DELETED" => Some(Self::Deleted),
                "APPROVED" => Some(Self::Approved),
                _ => None,
            }
        }
    }
}
/// Represents a bigquery routine.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Routine {
    /// Required. The type of routine.
    #[prost(enumeration = "routine::RoutineType", tag = "1")]
    pub routine_type: i32,
    /// Optional. The definition body of the routine.
    #[prost(string, tag = "2")]
    pub definition_body: ::prost::alloc::string::String,
}
/// Nested message and enum types in `Routine`.
pub mod routine {
    /// Represents the type of a given routine.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum RoutineType {
        /// Default value.
        Unspecified = 0,
        /// Non-built-in persistent TVF.
        TableValuedFunction = 1,
    }
    impl RoutineType {
        /// 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 => "ROUTINE_TYPE_UNSPECIFIED",
                Self::TableValuedFunction => "TABLE_VALUED_FUNCTION",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "ROUTINE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "TABLE_VALUED_FUNCTION" => Some(Self::TableValuedFunction),
                _ => None,
            }
        }
    }
}
/// Message for creating a QueryTemplate.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateQueryTemplateRequest {
    /// Required. The parent resource path of the QueryTemplate.
    /// e.g.
    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myQueryTemplate`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The ID of the QueryTemplate to create.
    /// Must contain only Unicode letters, numbers (0-9), underscores (\_).
    /// Max length: 100 bytes.
    #[prost(string, tag = "2")]
    pub query_template_id: ::prost::alloc::string::String,
    /// Required. The QueryTemplate to create.
    #[prost(message, optional, tag = "3")]
    pub query_template: ::core::option::Option<QueryTemplate>,
}
/// Message for creating a QueryTemplate.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetQueryTemplateRequest {
    /// Required. The parent resource path of the QueryTemplate.
    /// e.g.
    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Message for requesting the list of QueryTemplates.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListQueryTemplatesRequest {
    /// Required. The parent resource path of the QueryTemplates.
    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Optional. The maximum number of results to return in a single response
    /// page. Leverage the page tokens to iterate through the entire collection.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// Optional. Page token, returned by a previous call, to request the next page
    /// of results.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
}
/// Message for response to the list of QueryTemplates.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListQueryTemplatesResponse {
    /// The list of QueryTemplates.
    #[prost(message, repeated, tag = "1")]
    pub query_templates: ::prost::alloc::vec::Vec<QueryTemplate>,
    /// A token to request the next page of results.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Message for updating a QueryTemplate.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateQueryTemplateRequest {
    /// Optional. Field mask specifies the fields to update in the query template
    /// resource. The fields specified in the `updateMask` are relative to the
    /// resource and are not a full request.
    #[prost(message, optional, tag = "1")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
    /// Required. The QueryTemplate to update.
    #[prost(message, optional, tag = "2")]
    pub query_template: ::core::option::Option<QueryTemplate>,
}
/// Message for deleting a QueryTemplate.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteQueryTemplateRequest {
    /// Required. The resource path of the QueryTemplate.
    /// e.g.
    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Message for submitting a QueryTemplate.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SubmitQueryTemplateRequest {
    /// Required. The resource path of the QueryTemplate.
    /// e.g.
    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Message for approving a QueryTemplate.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ApproveQueryTemplateRequest {
    /// Required. The resource path of the QueryTemplate.
    /// e.g.
    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Sharing environment is a behavior model for sharing data within a
/// data exchange. This option is configurable for a data exchange.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SharingEnvironmentConfig {
    #[prost(oneof = "sharing_environment_config::Environment", tags = "1, 2")]
    pub environment: ::core::option::Option<sharing_environment_config::Environment>,
}
/// Nested message and enum types in `SharingEnvironmentConfig`.
pub mod sharing_environment_config {
    /// Default Analytics Hub data exchange, used for secured data sharing.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct DefaultExchangeConfig {}
    /// Data Clean Room (DCR), used for privacy-safe and secured data sharing.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct DcrExchangeConfig {
        /// Output only. If True, this DCR restricts the contributors to sharing
        /// only a single resource in a Listing. And no two resources should have the
        /// same IDs. So if a contributor adds a view with a conflicting name, the
        /// CreateListing API will reject the request. if False, the data contributor
        /// can publish an entire dataset (as before). This is not configurable, and
        /// by default, all new DCRs will have the restriction set to True.
        #[prost(bool, optional, tag = "1")]
        pub single_selected_resource_sharing_restriction: ::core::option::Option<bool>,
        /// Output only. If True, when subscribing to this DCR, it will create only
        /// one linked dataset containing all resources shared within the
        /// cleanroom. If False, when subscribing to this DCR, it will
        /// create 1 linked dataset per listing. This is not configurable, and by
        /// default, all new DCRs will have the restriction set to True.
        #[prost(bool, optional, tag = "2")]
        pub single_linked_dataset_per_cleanroom: ::core::option::Option<bool>,
    }
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Environment {
        /// Default Analytics Hub data exchange, used for secured data sharing.
        #[prost(message, tag = "1")]
        DefaultExchangeConfig(DefaultExchangeConfig),
        /// Data Clean Room (DCR), used for privacy-safe and secured data sharing.
        #[prost(message, tag = "2")]
        DcrExchangeConfig(DcrExchangeConfig),
    }
}
/// Contains details of the data provider.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DataProvider {
    /// Optional. Name of the data provider.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. Email or URL of the data provider.
    /// Max Length: 1000 bytes.
    #[prost(string, tag = "2")]
    pub primary_contact: ::prost::alloc::string::String,
}
/// Contains details of the listing publisher.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Publisher {
    /// Optional. Name of the listing publisher.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. Email or URL of the listing publisher.
    /// Max Length: 1000 bytes.
    #[prost(string, tag = "2")]
    pub primary_contact: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DestinationDatasetReference {
    /// Required. A unique ID for this dataset, without the project name. The ID
    /// must contain only letters (a-z, A-Z), numbers (0-9), or underscores (\_).
    /// The maximum length is 1,024 characters.
    #[prost(string, tag = "1")]
    pub dataset_id: ::prost::alloc::string::String,
    /// Required. The ID of the project containing this dataset.
    #[prost(string, tag = "2")]
    pub project_id: ::prost::alloc::string::String,
}
/// Defines the destination bigquery dataset.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DestinationDataset {
    /// Required. A reference that identifies the destination dataset.
    #[prost(message, optional, tag = "1")]
    pub dataset_reference: ::core::option::Option<DestinationDatasetReference>,
    /// Optional. A descriptive name for the dataset.
    #[prost(message, optional, tag = "2")]
    pub friendly_name: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional. A user-friendly description of the dataset.
    #[prost(message, optional, tag = "3")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional. The labels associated with this dataset. You can use these
    /// to organize and group your datasets.
    /// You can set this property when inserting or updating a dataset.
    /// See <https://cloud.google.com/resource-manager/docs/creating-managing-labels>
    /// for more information.
    #[prost(map = "string, string", tag = "4")]
    pub labels: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// Required. The geographic location where the dataset should reside. See
    /// <https://cloud.google.com/bigquery/docs/locations> for supported
    /// locations.
    #[prost(string, tag = "5")]
    pub location: ::prost::alloc::string::String,
    /// Optional. The geographic locations where the dataset should be replicated.
    /// See [BigQuery locations](<https://cloud.google.com/bigquery/docs/locations>)
    /// for supported locations.
    #[prost(string, repeated, tag = "6")]
    pub replica_locations: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Defines the destination Pub/Sub subscription.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DestinationPubSubSubscription {
    /// Required. Destination Pub/Sub subscription resource.
    #[prost(message, optional, tag = "1")]
    pub pubsub_subscription: ::core::option::Option<PubSubSubscription>,
}
/// A listing is what gets published into a data exchange that a subscriber can
/// subscribe to. It contains a reference to the data source along with
/// descriptive information that will help subscribers find and subscribe the
/// data.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Listing {
    /// Output only. The resource name of the listing.
    /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Required. Human-readable display name of the listing. The display name must
    /// contain only Unicode letters, numbers (0-9), underscores (\_), dashes (-),
    /// spaces ( ), ampersands (&) and can't start or end with spaces. Default
    /// value is an empty string. Max length: 63 bytes.
    #[prost(string, tag = "2")]
    pub display_name: ::prost::alloc::string::String,
    /// Optional. Short description of the listing. The description must not
    /// contain Unicode non-characters and C0 and C1 control codes except tabs
    /// (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default
    /// value is an empty string. Max length: 2000 bytes.
    #[prost(string, tag = "3")]
    pub description: ::prost::alloc::string::String,
    /// Optional. Email or URL of the primary point of contact of the listing.
    /// Max Length: 1000 bytes.
    #[prost(string, tag = "4")]
    pub primary_contact: ::prost::alloc::string::String,
    /// Optional. Documentation describing the listing.
    #[prost(string, tag = "5")]
    pub documentation: ::prost::alloc::string::String,
    /// Output only. Current state of the listing.
    #[prost(enumeration = "listing::State", tag = "7")]
    pub state: i32,
    /// Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB
    /// Expected image dimensions are 512x512 pixels, however the API only
    /// performs validation on size of the encoded data.
    /// Note: For byte fields, the contents of the field are base64-encoded (which
    /// increases the size of the data by 33-36%) when using JSON on the wire.
    #[prost(bytes = "vec", tag = "8")]
    pub icon: ::prost::alloc::vec::Vec<u8>,
    /// Optional. Details of the data provider who owns the source data.
    #[prost(message, optional, tag = "9")]
    pub data_provider: ::core::option::Option<DataProvider>,
    /// Optional. Categories of the listing. Up to five categories are allowed.
    #[prost(enumeration = "listing::Category", repeated, packed = "false", tag = "10")]
    pub categories: ::prost::alloc::vec::Vec<i32>,
    /// Optional. Details of the publisher who owns the listing and who can share
    /// the source data.
    #[prost(message, optional, tag = "11")]
    pub publisher: ::core::option::Option<Publisher>,
    /// Optional. Email or URL of the request access of the listing.
    /// Subscribers can use this reference to request access.
    /// Max Length: 1000 bytes.
    #[prost(string, tag = "12")]
    pub request_access: ::prost::alloc::string::String,
    /// Optional. If set, restricted export configuration will be propagated and
    /// enforced on the linked dataset.
    #[prost(message, optional, tag = "13")]
    pub restricted_export_config: ::core::option::Option<
        listing::RestrictedExportConfig,
    >,
    /// Optional. If set, stored procedure configuration will be propagated and
    /// enforced on the linked dataset.
    #[prost(message, optional, tag = "20")]
    pub stored_procedure_config: ::core::option::Option<StoredProcedureConfig>,
    /// Optional. Type of discovery of the listing on the discovery page.
    #[prost(enumeration = "DiscoveryType", optional, tag = "14")]
    pub discovery_type: ::core::option::Option<i32>,
    /// Output only. Listing shared asset type.
    #[prost(enumeration = "SharedResourceType", tag = "15")]
    pub resource_type: i32,
    /// Output only. Commercial info contains the information about the commercial
    /// data products associated with the listing.
    #[prost(message, optional, tag = "17")]
    pub commercial_info: ::core::option::Option<listing::CommercialInfo>,
    /// Optional. By default, false.
    /// If true, the Listing has an email sharing mandate enabled.
    #[prost(bool, optional, tag = "18")]
    pub log_linked_dataset_query_user_email: ::core::option::Option<bool>,
    /// Optional. If true, the listing is only available to get the resource
    /// metadata. Listing is non subscribable.
    #[prost(bool, optional, tag = "19")]
    pub allow_only_metadata_sharing: ::core::option::Option<bool>,
    /// Listing source.
    #[prost(oneof = "listing::Source", tags = "6, 16")]
    pub source: ::core::option::Option<listing::Source>,
}
/// Nested message and enum types in `Listing`.
pub mod listing {
    /// A reference to a shared dataset. It is an existing BigQuery dataset with a
    /// collection of objects such as tables and views that you want to share
    /// with subscribers.
    /// When subscriber's subscribe to a listing, Analytics Hub creates a linked
    /// dataset in
    /// the subscriber's project. A Linked dataset is an opaque, read-only BigQuery
    /// dataset that serves as a *symbolic link* to a shared dataset.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct BigQueryDatasetSource {
        /// Optional. Resource name of the dataset source for this listing.
        /// e.g. `projects/myproject/datasets/123`
        #[prost(string, tag = "1")]
        pub dataset: ::prost::alloc::string::String,
        /// Optional. Resource in this dataset that is selectively shared.
        /// This field is required for data clean room exchanges.
        #[prost(message, repeated, tag = "2")]
        pub selected_resources: ::prost::alloc::vec::Vec<
            big_query_dataset_source::SelectedResource,
        >,
        /// Optional. If set, restricted export policy will be propagated and
        /// enforced on the linked dataset.
        #[prost(message, optional, tag = "3")]
        pub restricted_export_policy: ::core::option::Option<
            big_query_dataset_source::RestrictedExportPolicy,
        >,
        /// Optional. A list of regions where the publisher has created shared
        /// dataset replicas.
        #[prost(string, repeated, tag = "5")]
        pub replica_locations: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
        /// Output only. Server-owned effective state of replicas.
        /// Contains both primary and secondary replicas.
        /// Each replica includes a system-computed (output-only) state and primary
        /// designation.
        #[prost(message, repeated, tag = "6")]
        pub effective_replicas: ::prost::alloc::vec::Vec<
            big_query_dataset_source::Replica,
        >,
    }
    /// Nested message and enum types in `BigQueryDatasetSource`.
    pub mod big_query_dataset_source {
        /// Resource in this dataset that is selectively shared.
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct SelectedResource {
            #[prost(oneof = "selected_resource::Resource", tags = "1, 2")]
            pub resource: ::core::option::Option<selected_resource::Resource>,
        }
        /// Nested message and enum types in `SelectedResource`.
        pub mod selected_resource {
            #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
            pub enum Resource {
                /// Optional. Format:
                /// For table:
                /// `projects/{projectId}/datasets/{datasetId}/tables/{tableId}`
                /// Example:"projects/test_project/datasets/test_dataset/tables/test_table"
                #[prost(string, tag = "1")]
                Table(::prost::alloc::string::String),
                /// Optional. Format:
                /// For routine:
                /// `projects/{projectId}/datasets/{datasetId}/routines/{routineId}`
                /// Example:"projects/test_project/datasets/test_dataset/routines/test_routine"
                #[prost(string, tag = "2")]
                Routine(::prost::alloc::string::String),
            }
        }
        /// Restricted export policy used to configure restricted export on linked
        /// dataset.
        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct RestrictedExportPolicy {
            /// Optional. If true, enable restricted export.
            #[prost(message, optional, tag = "1")]
            pub enabled: ::core::option::Option<bool>,
            /// Optional. If true, restrict direct table access (read
            /// api/tabledata.list) on linked table.
            #[prost(message, optional, tag = "2")]
            pub restrict_direct_table_access: ::core::option::Option<bool>,
            /// Optional. If true, restrict export of query result derived from
            /// restricted linked dataset table.
            #[prost(message, optional, tag = "3")]
            pub restrict_query_result: ::core::option::Option<bool>,
        }
        /// Represents the state of a replica of a shared dataset.
        /// It includes the geographic location of the replica and
        /// system-computed, output-only fields indicating its replication state and
        /// whether it is the primary replica.
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct Replica {
            /// Output only. The geographic location where the replica resides. See
            /// [BigQuery locations](<https://cloud.google.com/bigquery/docs/locations>)
            /// for supported locations. Eg. "us-central1".
            #[prost(string, tag = "1")]
            pub location: ::prost::alloc::string::String,
            /// Output only. Assigned by Analytics Hub based on real BigQuery
            /// replication state.
            #[prost(enumeration = "replica::ReplicaState", tag = "2")]
            pub replica_state: i32,
            /// Output only. Indicates that this replica is the primary replica.
            #[prost(enumeration = "replica::PrimaryState", optional, tag = "3")]
            pub primary_state: ::core::option::Option<i32>,
        }
        /// Nested message and enum types in `Replica`.
        pub mod replica {
            /// Replica state of the shared dataset.
            #[derive(
                Clone,
                Copy,
                Debug,
                PartialEq,
                Eq,
                Hash,
                PartialOrd,
                Ord,
                ::prost::Enumeration
            )]
            #[repr(i32)]
            pub enum ReplicaState {
                /// Default value. This value is unused.
                Unspecified = 0,
                /// The replica is backfilled and ready to use.
                ReadyToUse = 1,
                /// The replica is unavailable, does not exist, or has not been
                /// backfilled yet.
                Unavailable = 2,
            }
            impl ReplicaState {
                /// 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 => "REPLICA_STATE_UNSPECIFIED",
                        Self::ReadyToUse => "READY_TO_USE",
                        Self::Unavailable => "UNAVAILABLE",
                    }
                }
                /// Creates an enum from field names used in the ProtoBuf definition.
                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                    match value {
                        "REPLICA_STATE_UNSPECIFIED" => Some(Self::Unspecified),
                        "READY_TO_USE" => Some(Self::ReadyToUse),
                        "UNAVAILABLE" => Some(Self::Unavailable),
                        _ => None,
                    }
                }
            }
            /// Primary state of the replica. Set only for the primary replica.
            #[derive(
                Clone,
                Copy,
                Debug,
                PartialEq,
                Eq,
                Hash,
                PartialOrd,
                Ord,
                ::prost::Enumeration
            )]
            #[repr(i32)]
            pub enum PrimaryState {
                /// Default value. This value is unused.
                Unspecified = 0,
                /// The replica is the primary replica.
                PrimaryReplica = 1,
            }
            impl PrimaryState {
                /// 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 => "PRIMARY_STATE_UNSPECIFIED",
                        Self::PrimaryReplica => "PRIMARY_REPLICA",
                    }
                }
                /// Creates an enum from field names used in the ProtoBuf definition.
                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                    match value {
                        "PRIMARY_STATE_UNSPECIFIED" => Some(Self::Unspecified),
                        "PRIMARY_REPLICA" => Some(Self::PrimaryReplica),
                        _ => None,
                    }
                }
            }
        }
    }
    /// Pub/Sub topic source.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct PubSubTopicSource {
        /// Required. Resource name of the Pub/Sub topic source for this listing.
        /// e.g. projects/myproject/topics/topicId
        #[prost(string, tag = "1")]
        pub topic: ::prost::alloc::string::String,
        /// Optional. Region hint on where the data might be published. Data affinity
        /// regions are modifiable. See <https://cloud.google.com/about/locations> for
        /// full listing of possible Cloud regions.
        #[prost(string, repeated, tag = "2")]
        pub data_affinity_regions: ::prost::alloc::vec::Vec<
            ::prost::alloc::string::String,
        >,
    }
    /// Restricted export config, used to configure restricted export on linked
    /// dataset.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct RestrictedExportConfig {
        /// Optional. If true, enable restricted export.
        #[prost(bool, tag = "3")]
        pub enabled: bool,
        /// Output only. If true, restrict direct table access(read
        /// api/tabledata.list) on linked table.
        #[prost(bool, tag = "1")]
        pub restrict_direct_table_access: bool,
        /// Optional. If true, restrict export of query result derived from
        /// restricted linked dataset table.
        #[prost(bool, tag = "2")]
        pub restrict_query_result: bool,
    }
    /// Commercial info contains the information about the commercial data products
    /// associated with the listing.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct CommercialInfo {
        /// Output only. Details of the Marketplace Data Product associated with the
        /// Listing.
        #[prost(message, optional, tag = "1")]
        pub cloud_marketplace: ::core::option::Option<
            commercial_info::GoogleCloudMarketplaceInfo,
        >,
    }
    /// Nested message and enum types in `CommercialInfo`.
    pub mod commercial_info {
        /// Specifies the details of the Marketplace Data Product associated with the
        /// Listing.
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct GoogleCloudMarketplaceInfo {
            /// Output only. Resource name of the commercial service associated with
            /// the Marketplace Data Product. e.g. example.com
            #[prost(string, optional, tag = "1")]
            pub service: ::core::option::Option<::prost::alloc::string::String>,
            /// Output only. Commercial state of the Marketplace Data Product.
            #[prost(
                enumeration = "google_cloud_marketplace_info::CommercialState",
                optional,
                tag = "3"
            )]
            pub commercial_state: ::core::option::Option<i32>,
        }
        /// Nested message and enum types in `GoogleCloudMarketplaceInfo`.
        pub mod google_cloud_marketplace_info {
            /// Indicates whether this commercial access is currently active.
            #[derive(
                Clone,
                Copy,
                Debug,
                PartialEq,
                Eq,
                Hash,
                PartialOrd,
                Ord,
                ::prost::Enumeration
            )]
            #[repr(i32)]
            pub enum CommercialState {
                /// Commercialization is incomplete and cannot be used.
                Unspecified = 0,
                /// Commercialization has been initialized.
                Onboarding = 1,
                /// Commercialization is complete and available for use.
                Active = 2,
            }
            impl CommercialState {
                /// 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 => "COMMERCIAL_STATE_UNSPECIFIED",
                        Self::Onboarding => "ONBOARDING",
                        Self::Active => "ACTIVE",
                    }
                }
                /// Creates an enum from field names used in the ProtoBuf definition.
                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                    match value {
                        "COMMERCIAL_STATE_UNSPECIFIED" => Some(Self::Unspecified),
                        "ONBOARDING" => Some(Self::Onboarding),
                        "ACTIVE" => Some(Self::Active),
                        _ => None,
                    }
                }
            }
        }
    }
    /// State of the listing.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum State {
        /// Default value. This value is unused.
        Unspecified = 0,
        /// Subscribable state. Users with dataexchange.listings.subscribe permission
        /// can subscribe to this listing.
        Active = 1,
    }
    impl State {
        /// 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 => "STATE_UNSPECIFIED",
                Self::Active => "ACTIVE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "ACTIVE" => Some(Self::Active),
                _ => None,
            }
        }
    }
    /// Listing categories.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Category {
        Unspecified = 0,
        Others = 1,
        AdvertisingAndMarketing = 2,
        Commerce = 3,
        ClimateAndEnvironment = 4,
        Demographics = 5,
        Economics = 6,
        Education = 7,
        Energy = 8,
        Financial = 9,
        Gaming = 10,
        Geospatial = 11,
        HealthcareAndLifeScience = 12,
        Media = 13,
        PublicSector = 14,
        Retail = 15,
        Sports = 16,
        ScienceAndResearch = 17,
        TransportationAndLogistics = 18,
        TravelAndTourism = 19,
        GoogleEarthEngine = 20,
    }
    impl Category {
        /// 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 => "CATEGORY_UNSPECIFIED",
                Self::Others => "CATEGORY_OTHERS",
                Self::AdvertisingAndMarketing => "CATEGORY_ADVERTISING_AND_MARKETING",
                Self::Commerce => "CATEGORY_COMMERCE",
                Self::ClimateAndEnvironment => "CATEGORY_CLIMATE_AND_ENVIRONMENT",
                Self::Demographics => "CATEGORY_DEMOGRAPHICS",
                Self::Economics => "CATEGORY_ECONOMICS",
                Self::Education => "CATEGORY_EDUCATION",
                Self::Energy => "CATEGORY_ENERGY",
                Self::Financial => "CATEGORY_FINANCIAL",
                Self::Gaming => "CATEGORY_GAMING",
                Self::Geospatial => "CATEGORY_GEOSPATIAL",
                Self::HealthcareAndLifeScience => "CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE",
                Self::Media => "CATEGORY_MEDIA",
                Self::PublicSector => "CATEGORY_PUBLIC_SECTOR",
                Self::Retail => "CATEGORY_RETAIL",
                Self::Sports => "CATEGORY_SPORTS",
                Self::ScienceAndResearch => "CATEGORY_SCIENCE_AND_RESEARCH",
                Self::TransportationAndLogistics => {
                    "CATEGORY_TRANSPORTATION_AND_LOGISTICS"
                }
                Self::TravelAndTourism => "CATEGORY_TRAVEL_AND_TOURISM",
                Self::GoogleEarthEngine => "CATEGORY_GOOGLE_EARTH_ENGINE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "CATEGORY_UNSPECIFIED" => Some(Self::Unspecified),
                "CATEGORY_OTHERS" => Some(Self::Others),
                "CATEGORY_ADVERTISING_AND_MARKETING" => {
                    Some(Self::AdvertisingAndMarketing)
                }
                "CATEGORY_COMMERCE" => Some(Self::Commerce),
                "CATEGORY_CLIMATE_AND_ENVIRONMENT" => Some(Self::ClimateAndEnvironment),
                "CATEGORY_DEMOGRAPHICS" => Some(Self::Demographics),
                "CATEGORY_ECONOMICS" => Some(Self::Economics),
                "CATEGORY_EDUCATION" => Some(Self::Education),
                "CATEGORY_ENERGY" => Some(Self::Energy),
                "CATEGORY_FINANCIAL" => Some(Self::Financial),
                "CATEGORY_GAMING" => Some(Self::Gaming),
                "CATEGORY_GEOSPATIAL" => Some(Self::Geospatial),
                "CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE" => {
                    Some(Self::HealthcareAndLifeScience)
                }
                "CATEGORY_MEDIA" => Some(Self::Media),
                "CATEGORY_PUBLIC_SECTOR" => Some(Self::PublicSector),
                "CATEGORY_RETAIL" => Some(Self::Retail),
                "CATEGORY_SPORTS" => Some(Self::Sports),
                "CATEGORY_SCIENCE_AND_RESEARCH" => Some(Self::ScienceAndResearch),
                "CATEGORY_TRANSPORTATION_AND_LOGISTICS" => {
                    Some(Self::TransportationAndLogistics)
                }
                "CATEGORY_TRAVEL_AND_TOURISM" => Some(Self::TravelAndTourism),
                "CATEGORY_GOOGLE_EARTH_ENGINE" => Some(Self::GoogleEarthEngine),
                _ => None,
            }
        }
    }
    /// Listing source.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Source {
        /// Shared dataset i.e. BigQuery dataset source.
        #[prost(message, tag = "6")]
        BigqueryDataset(BigQueryDatasetSource),
        /// Pub/Sub topic source.
        #[prost(message, tag = "16")]
        PubsubTopic(PubSubTopicSource),
    }
}
/// Stored procedure configuration, used to configure stored procedure sharing
/// on linked dataset.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StoredProcedureConfig {
    /// Optional. If true, enable sharing of stored procedure.
    #[prost(bool, tag = "1")]
    pub enabled: bool,
    /// Output only. Types of stored procedure supported to share.
    #[prost(
        enumeration = "stored_procedure_config::StoredProcedureType",
        repeated,
        packed = "false",
        tag = "2"
    )]
    pub allowed_stored_procedure_types: ::prost::alloc::vec::Vec<i32>,
}
/// Nested message and enum types in `StoredProcedureConfig`.
pub mod stored_procedure_config {
    /// Enum to specify the type of stored procedure to share.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum StoredProcedureType {
        /// Default value. This value is unused.
        Unspecified = 0,
        /// SQL stored procedure.
        SqlProcedure = 1,
    }
    impl StoredProcedureType {
        /// 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 => "STORED_PROCEDURE_TYPE_UNSPECIFIED",
                Self::SqlProcedure => "SQL_PROCEDURE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STORED_PROCEDURE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "SQL_PROCEDURE" => Some(Self::SqlProcedure),
                _ => None,
            }
        }
    }
}
/// A subscription represents a subscribers' access to a particular set of
/// published data. It contains references to associated listings,
/// data exchanges, and linked datasets.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Subscription {
    /// Output only. The resource name of the subscription.
    /// e.g. `projects/myproject/locations/us/subscriptions/123`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Output only. Timestamp when the subscription was created.
    #[prost(message, optional, tag = "2")]
    pub creation_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. Timestamp when the subscription was last modified.
    #[prost(message, optional, tag = "3")]
    pub last_modify_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. Organization of the project this subscription belongs to.
    #[prost(string, tag = "4")]
    pub organization_id: ::prost::alloc::string::String,
    /// Output only. Display name of the project of this subscription.
    #[prost(string, tag = "10")]
    pub organization_display_name: ::prost::alloc::string::String,
    /// Output only. Current state of the subscription.
    #[prost(enumeration = "subscription::State", tag = "7")]
    pub state: i32,
    /// Output only. Map of listing resource names to associated linked resource,
    /// e.g. projects/123/locations/us/dataExchanges/456/listings/789
    /// ->
    /// projects/123/datasets/my_dataset
    ///
    /// For listing-level subscriptions, this is a map of size 1.
    /// Only contains values if state == STATE_ACTIVE.
    #[prost(map = "string, message", tag = "8")]
    pub linked_dataset_map: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        subscription::LinkedResource,
    >,
    /// Output only. Email of the subscriber.
    #[prost(string, tag = "9")]
    pub subscriber_contact: ::prost::alloc::string::String,
    /// Output only. Linked resources created in the subscription. Only contains
    /// values if state = STATE_ACTIVE.
    #[prost(message, repeated, tag = "11")]
    pub linked_resources: ::prost::alloc::vec::Vec<subscription::LinkedResource>,
    /// Output only. Listing shared asset type.
    #[prost(enumeration = "SharedResourceType", tag = "12")]
    pub resource_type: i32,
    /// Output only. This is set if this is a commercial subscription i.e. if this
    /// subscription was created from subscribing to a commercial listing.
    #[prost(message, optional, tag = "13")]
    pub commercial_info: ::core::option::Option<subscription::CommercialInfo>,
    /// Output only. By default, false.
    /// If true, the Subscriber agreed to the email sharing mandate
    /// that is enabled for DataExchange/Listing.
    #[prost(bool, optional, tag = "14")]
    pub log_linked_dataset_query_user_email: ::core::option::Option<bool>,
    /// Optional. BigQuery destination dataset to create for the subscriber.
    #[prost(message, optional, tag = "15")]
    pub destination_dataset: ::core::option::Option<DestinationDataset>,
    #[prost(oneof = "subscription::ResourceName", tags = "5, 6")]
    pub resource_name: ::core::option::Option<subscription::ResourceName>,
}
/// Nested message and enum types in `Subscription`.
pub mod subscription {
    /// Reference to a linked resource tracked by this Subscription.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct LinkedResource {
        /// Output only. Listing for which linked resource is created.
        #[prost(string, tag = "2")]
        pub listing: ::prost::alloc::string::String,
        #[prost(oneof = "linked_resource::Reference", tags = "1, 3")]
        pub reference: ::core::option::Option<linked_resource::Reference>,
    }
    /// Nested message and enum types in `LinkedResource`.
    pub mod linked_resource {
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
        pub enum Reference {
            /// Output only. Name of the linked dataset, e.g.
            /// projects/subscriberproject/datasets/linked_dataset
            #[prost(string, tag = "1")]
            LinkedDataset(::prost::alloc::string::String),
            /// Output only. Name of the Pub/Sub subscription, e.g.
            /// projects/subscriberproject/subscriptions/subscriptions/sub_id
            #[prost(string, tag = "3")]
            LinkedPubsubSubscription(::prost::alloc::string::String),
        }
    }
    /// Commercial info metadata for this subscription.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct CommercialInfo {
        /// Output only. This is set when the subscription is commercialised via
        /// Cloud Marketplace.
        #[prost(message, optional, tag = "1")]
        pub cloud_marketplace: ::core::option::Option<
            commercial_info::GoogleCloudMarketplaceInfo,
        >,
    }
    /// Nested message and enum types in `CommercialInfo`.
    pub mod commercial_info {
        /// Cloud Marketplace commercial metadata for this subscription.
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct GoogleCloudMarketplaceInfo {
            /// Resource name of the Marketplace Order.
            #[prost(string, tag = "1")]
            pub order: ::prost::alloc::string::String,
        }
    }
    /// State of the subscription.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum State {
        /// Default value. This value is unused.
        Unspecified = 0,
        /// This subscription is active and the data is accessible.
        Active = 1,
        /// The data referenced by this subscription is out of date and should be
        /// refreshed. This can happen when a data provider adds or removes datasets.
        Stale = 2,
        /// This subscription has been cancelled or revoked and the data is no longer
        /// accessible.
        Inactive = 3,
    }
    impl State {
        /// 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 => "STATE_UNSPECIFIED",
                Self::Active => "STATE_ACTIVE",
                Self::Stale => "STATE_STALE",
                Self::Inactive => "STATE_INACTIVE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "STATE_ACTIVE" => Some(Self::Active),
                "STATE_STALE" => Some(Self::Stale),
                "STATE_INACTIVE" => Some(Self::Inactive),
                _ => None,
            }
        }
    }
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum ResourceName {
        /// Output only. Resource name of the source Listing.
        /// e.g. projects/123/locations/us/dataExchanges/456/listings/789
        #[prost(string, tag = "5")]
        Listing(::prost::alloc::string::String),
        /// Output only. Resource name of the source Data Exchange.
        /// e.g. projects/123/locations/us/dataExchanges/456
        #[prost(string, tag = "6")]
        DataExchange(::prost::alloc::string::String),
    }
}
/// Message for requesting the list of data exchanges.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListDataExchangesRequest {
    /// Required. The parent resource path of the data exchanges.
    /// e.g. `projects/myproject/locations/us`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// The maximum number of results to return in a single response page. Leverage
    /// the page tokens to iterate through the entire collection.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// Page token, returned by a previous call, to request the next page of
    /// results.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
}
/// Message for response to the list of data exchanges.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDataExchangesResponse {
    /// The list of data exchanges.
    #[prost(message, repeated, tag = "1")]
    pub data_exchanges: ::prost::alloc::vec::Vec<DataExchange>,
    /// A token to request the next page of results.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Message for requesting the list of data exchanges from projects in an
/// organization and location.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListOrgDataExchangesRequest {
    /// Required. The organization resource path of the projects containing
    /// DataExchanges. e.g. `organizations/myorg/locations/us`.
    #[prost(string, tag = "1")]
    pub organization: ::prost::alloc::string::String,
    /// The maximum number of results to return in a single response page. Leverage
    /// the page tokens to iterate through the entire collection.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// Page token, returned by a previous call, to request the next page of
    /// results.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
}
/// Message for response to listing data exchanges in an organization and
/// location.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOrgDataExchangesResponse {
    /// The list of data exchanges.
    #[prost(message, repeated, tag = "1")]
    pub data_exchanges: ::prost::alloc::vec::Vec<DataExchange>,
    /// A token to request the next page of results.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Message for getting a data exchange.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetDataExchangeRequest {
    /// Required. The resource name of the data exchange.
    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Message for creating a data exchange.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateDataExchangeRequest {
    /// Required. The parent resource path of the data exchange.
    /// e.g. `projects/myproject/locations/us`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The ID of the data exchange.
    /// Must contain only Unicode letters, numbers (0-9), underscores (\_).
    /// Max length: 100 bytes.
    #[prost(string, tag = "2")]
    pub data_exchange_id: ::prost::alloc::string::String,
    /// Required. The data exchange to create.
    #[prost(message, optional, tag = "3")]
    pub data_exchange: ::core::option::Option<DataExchange>,
}
/// Message for updating a data exchange.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateDataExchangeRequest {
    /// Required. Field mask specifies the fields to update in the data exchange
    /// resource. The fields specified in the
    /// `updateMask` are relative to the resource and are not a full request.
    #[prost(message, optional, tag = "1")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
    /// Required. The data exchange to update.
    #[prost(message, optional, tag = "2")]
    pub data_exchange: ::core::option::Option<DataExchange>,
}
/// Message for deleting a data exchange.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteDataExchangeRequest {
    /// Required. The full name of the data exchange resource that you want to
    /// delete. For example, `projects/myproject/locations/us/dataExchanges/123`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Message for requesting the list of listings.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListListingsRequest {
    /// Required. The parent resource path of the listing.
    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// The maximum number of results to return in a single response page. Leverage
    /// the page tokens to iterate through the entire collection.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// Page token, returned by a previous call, to request the next page of
    /// results.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
}
/// Message for response to the list of Listings.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListListingsResponse {
    /// The list of Listing.
    #[prost(message, repeated, tag = "1")]
    pub listings: ::prost::alloc::vec::Vec<Listing>,
    /// A token to request the next page of results.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Message for getting a listing.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetListingRequest {
    /// Required. The resource name of the listing.
    /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Message for creating a listing.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateListingRequest {
    /// Required. The parent resource path of the listing.
    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The ID of the listing to create.
    /// Must contain only Unicode letters, numbers (0-9), underscores (\_).
    /// Max length: 100 bytes.
    #[prost(string, tag = "2")]
    pub listing_id: ::prost::alloc::string::String,
    /// Required. The listing to create.
    #[prost(message, optional, tag = "3")]
    pub listing: ::core::option::Option<Listing>,
}
/// Message for updating a Listing.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateListingRequest {
    /// Required. Field mask specifies the fields to update in the listing
    /// resource. The fields specified in the `updateMask` are relative to the
    /// resource and are not a full request.
    #[prost(message, optional, tag = "1")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
    /// Required. The listing to update.
    #[prost(message, optional, tag = "2")]
    pub listing: ::core::option::Option<Listing>,
}
/// Message for deleting a listing.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteListingRequest {
    /// Required. Resource name of the listing to delete.
    /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. If the listing is commercial then this field must be set to true,
    /// otherwise a failure is thrown. This acts as a safety guard to avoid
    /// deleting commercial listings accidentally.
    #[prost(bool, tag = "2")]
    pub delete_commercial: bool,
}
/// Message for subscribing to a listing.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeListingRequest {
    /// Required. Resource name of the listing that you want to subscribe to.
    /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Resulting destination of the listing that you subscribed to.
    #[prost(oneof = "subscribe_listing_request::Destination", tags = "3, 5")]
    pub destination: ::core::option::Option<subscribe_listing_request::Destination>,
}
/// Nested message and enum types in `SubscribeListingRequest`.
pub mod subscribe_listing_request {
    /// Resulting destination of the listing that you subscribed to.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Destination {
        /// Input only. BigQuery destination dataset to create for the subscriber.
        #[prost(message, tag = "3")]
        DestinationDataset(super::DestinationDataset),
        /// Input only. Destination Pub/Sub subscription to create for the
        /// subscriber.
        #[prost(message, tag = "5")]
        DestinationPubsubSubscription(super::DestinationPubSubSubscription),
    }
}
/// Message for response when you subscribe to a listing.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeListingResponse {
    /// Subscription object created from this subscribe action.
    #[prost(message, optional, tag = "1")]
    pub subscription: ::core::option::Option<Subscription>,
}
/// Message for subscribing to a Data Exchange.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeDataExchangeRequest {
    /// Required. Resource name of the Data Exchange.
    /// e.g. `projects/publisherproject/locations/us/dataExchanges/123`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Required. The parent resource path of the Subscription.
    /// e.g. `projects/subscriberproject/locations/us`
    #[prost(string, tag = "2")]
    pub destination: ::prost::alloc::string::String,
    /// Optional. BigQuery destination dataset to create for the subscriber.
    #[prost(message, optional, tag = "5")]
    pub destination_dataset: ::core::option::Option<DestinationDataset>,
    /// Required. Name of the subscription to create.
    /// e.g. `subscription1`
    #[prost(string, tag = "4")]
    pub subscription: ::prost::alloc::string::String,
    /// Email of the subscriber.
    #[prost(string, tag = "3")]
    pub subscriber_contact: ::prost::alloc::string::String,
}
/// Message for response when you subscribe to a Data Exchange.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeDataExchangeResponse {
    /// Subscription object created from this subscribe action.
    #[prost(message, optional, tag = "1")]
    pub subscription: ::core::option::Option<Subscription>,
}
/// Message for refreshing a subscription.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RefreshSubscriptionRequest {
    /// Required. Resource name of the Subscription to refresh.
    /// e.g. `projects/subscriberproject/locations/us/subscriptions/123`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Message for response when you refresh a subscription.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RefreshSubscriptionResponse {
    /// The refreshed subscription resource.
    #[prost(message, optional, tag = "1")]
    pub subscription: ::core::option::Option<Subscription>,
}
/// Message for getting a subscription.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetSubscriptionRequest {
    /// Required. Resource name of the subscription.
    /// e.g. projects/123/locations/us/subscriptions/456
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Message for listing subscriptions.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListSubscriptionsRequest {
    /// Required. The parent resource path of the subscription.
    /// e.g. projects/myproject/locations/us
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// An expression for filtering the results of the request. Eligible
    /// fields for filtering are:
    ///
    /// * `listing`
    /// * `data_exchange`
    ///
    /// Alternatively, a literal wrapped in double quotes may be provided.
    /// This will be checked for an exact match against both fields above.
    ///
    /// In all cases, the full Data Exchange or Listing resource name must
    /// be provided. Some example of using filters:
    ///
    /// * data_exchange="projects/myproject/locations/us/dataExchanges/123"
    /// * listing="projects/123/locations/us/dataExchanges/456/listings/789"
    /// * "projects/myproject/locations/us/dataExchanges/123"
    #[prost(string, tag = "2")]
    pub filter: ::prost::alloc::string::String,
    /// The maximum number of results to return in a single response page.
    #[prost(int32, tag = "3")]
    pub page_size: i32,
    /// Page token, returned by a previous call.
    #[prost(string, tag = "4")]
    pub page_token: ::prost::alloc::string::String,
}
/// Message for response to the listing of subscriptions.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSubscriptionsResponse {
    /// The list of subscriptions.
    #[prost(message, repeated, tag = "1")]
    pub subscriptions: ::prost::alloc::vec::Vec<Subscription>,
    /// Next page token.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Message for listing subscriptions of a shared resource.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListSharedResourceSubscriptionsRequest {
    /// Required. Resource name of the requested target. This resource may be
    /// either a Listing or a DataExchange. e.g.
    /// projects/123/locations/us/dataExchanges/456 OR e.g.
    /// projects/123/locations/us/dataExchanges/456/listings/789
    #[prost(string, tag = "1")]
    pub resource: ::prost::alloc::string::String,
    /// If selected, includes deleted subscriptions in the response
    /// (up to 63 days after deletion).
    #[prost(bool, tag = "2")]
    pub include_deleted_subscriptions: bool,
    /// The maximum number of results to return in a single response page.
    #[prost(int32, tag = "3")]
    pub page_size: i32,
    /// Page token, returned by a previous call.
    #[prost(string, tag = "4")]
    pub page_token: ::prost::alloc::string::String,
}
/// Message for response to the listing of shared resource subscriptions.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSharedResourceSubscriptionsResponse {
    /// The list of subscriptions.
    #[prost(message, repeated, tag = "1")]
    pub shared_resource_subscriptions: ::prost::alloc::vec::Vec<Subscription>,
    /// Next page token.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Message for revoking a subscription.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RevokeSubscriptionRequest {
    /// Required. Resource name of the subscription to revoke.
    /// e.g. projects/123/locations/us/subscriptions/456
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. If the subscription is commercial then this field must be set to
    /// true, otherwise a failure is thrown. This acts as a safety guard to avoid
    /// revoking commercial subscriptions accidentally.
    #[prost(bool, tag = "2")]
    pub revoke_commercial: bool,
}
/// Message for response when you revoke a subscription.
/// Empty for now.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RevokeSubscriptionResponse {}
/// Message for deleting a subscription.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteSubscriptionRequest {
    /// Required. Resource name of the subscription to delete.
    /// e.g. projects/123/locations/us/subscriptions/456
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Represents the metadata of a long-running operation in Analytics Hub.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct OperationMetadata {
    /// Output only. The time the operation was created.
    #[prost(message, optional, tag = "1")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The time the operation finished running.
    #[prost(message, optional, tag = "2")]
    pub end_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. Server-defined resource path for the target of the operation.
    #[prost(string, tag = "3")]
    pub target: ::prost::alloc::string::String,
    /// Output only. Name of the verb executed by the operation.
    #[prost(string, tag = "4")]
    pub verb: ::prost::alloc::string::String,
    /// Output only. Human-readable status of the operation, if any.
    #[prost(string, tag = "5")]
    pub status_message: ::prost::alloc::string::String,
    /// Output only. Identifies whether the user has requested cancellation
    /// of the operation. Operations that have successfully been cancelled
    /// have \[Operation.error\]\[\] value with a
    /// \[google.rpc.Status.code\]\[google.rpc.Status.code\] of 1, corresponding to
    /// `Code.CANCELLED`.
    #[prost(bool, tag = "6")]
    pub requested_cancellation: bool,
    /// Output only. API version used to start the operation.
    #[prost(string, tag = "7")]
    pub api_version: ::prost::alloc::string::String,
}
/// Specifies the type of discovery on the discovery page. Note that
/// this does not control the visibility of the exchange/listing which is
/// defined by IAM permission.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DiscoveryType {
    /// Unspecified. Defaults to DISCOVERY_TYPE_PRIVATE.
    Unspecified = 0,
    /// The Data exchange/listing can be discovered in the 'Private' results
    /// list.
    Private = 1,
    /// The Data exchange/listing can be discovered in the 'Public' results
    /// list.
    Public = 2,
}
impl DiscoveryType {
    /// 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 => "DISCOVERY_TYPE_UNSPECIFIED",
            Self::Private => "DISCOVERY_TYPE_PRIVATE",
            Self::Public => "DISCOVERY_TYPE_PUBLIC",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "DISCOVERY_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "DISCOVERY_TYPE_PRIVATE" => Some(Self::Private),
            "DISCOVERY_TYPE_PUBLIC" => Some(Self::Public),
            _ => None,
        }
    }
}
/// The underlying shared asset type shared in a listing by a publisher.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SharedResourceType {
    /// Not specified.
    Unspecified = 0,
    /// BigQuery Dataset Asset.
    BigqueryDataset = 1,
    /// Pub/Sub Topic Asset.
    PubsubTopic = 2,
}
impl SharedResourceType {
    /// 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 => "SHARED_RESOURCE_TYPE_UNSPECIFIED",
            Self::BigqueryDataset => "BIGQUERY_DATASET",
            Self::PubsubTopic => "PUBSUB_TOPIC",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "SHARED_RESOURCE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "BIGQUERY_DATASET" => Some(Self::BigqueryDataset),
            "PUBSUB_TOPIC" => Some(Self::PubsubTopic),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod analytics_hub_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// The `AnalyticsHubService` API facilitates data sharing within and across
    /// organizations. It allows data providers to publish listings that reference
    /// shared datasets. With Analytics Hub, users can discover and search for
    /// listings that they have access to. Subscribers can view and subscribe to
    /// listings. When you subscribe to a listing, Analytics Hub creates a linked
    /// dataset in your project.
    #[derive(Debug, Clone)]
    pub struct AnalyticsHubServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl AnalyticsHubServiceClient<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> AnalyticsHubServiceClient<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,
        ) -> AnalyticsHubServiceClient<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,
        {
            AnalyticsHubServiceClient::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
        }
        /// Lists all data exchanges in a given project and location.
        pub async fn list_data_exchanges(
            &mut self,
            request: impl tonic::IntoRequest<super::ListDataExchangesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListDataExchangesResponse>,
            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.bigquery.analyticshub.v1.AnalyticsHubService/ListDataExchanges",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "ListDataExchanges",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists all data exchanges from projects in a given organization and
        /// location.
        pub async fn list_org_data_exchanges(
            &mut self,
            request: impl tonic::IntoRequest<super::ListOrgDataExchangesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListOrgDataExchangesResponse>,
            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.bigquery.analyticshub.v1.AnalyticsHubService/ListOrgDataExchanges",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "ListOrgDataExchanges",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets the details of a data exchange.
        pub async fn get_data_exchange(
            &mut self,
            request: impl tonic::IntoRequest<super::GetDataExchangeRequest>,
        ) -> std::result::Result<tonic::Response<super::DataExchange>, 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.bigquery.analyticshub.v1.AnalyticsHubService/GetDataExchange",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "GetDataExchange",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Creates a new data exchange.
        pub async fn create_data_exchange(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateDataExchangeRequest>,
        ) -> std::result::Result<tonic::Response<super::DataExchange>, 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.bigquery.analyticshub.v1.AnalyticsHubService/CreateDataExchange",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "CreateDataExchange",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates an existing data exchange.
        pub async fn update_data_exchange(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateDataExchangeRequest>,
        ) -> std::result::Result<tonic::Response<super::DataExchange>, 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.bigquery.analyticshub.v1.AnalyticsHubService/UpdateDataExchange",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "UpdateDataExchange",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes an existing data exchange.
        pub async fn delete_data_exchange(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteDataExchangeRequest>,
        ) -> 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.bigquery.analyticshub.v1.AnalyticsHubService/DeleteDataExchange",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "DeleteDataExchange",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists all listings in a given project and location.
        pub async fn list_listings(
            &mut self,
            request: impl tonic::IntoRequest<super::ListListingsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListListingsResponse>,
            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.bigquery.analyticshub.v1.AnalyticsHubService/ListListings",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "ListListings",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets the details of a listing.
        pub async fn get_listing(
            &mut self,
            request: impl tonic::IntoRequest<super::GetListingRequest>,
        ) -> std::result::Result<tonic::Response<super::Listing>, 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.bigquery.analyticshub.v1.AnalyticsHubService/GetListing",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "GetListing",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Creates a new listing.
        pub async fn create_listing(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateListingRequest>,
        ) -> std::result::Result<tonic::Response<super::Listing>, 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.bigquery.analyticshub.v1.AnalyticsHubService/CreateListing",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "CreateListing",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates an existing listing.
        pub async fn update_listing(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateListingRequest>,
        ) -> std::result::Result<tonic::Response<super::Listing>, 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.bigquery.analyticshub.v1.AnalyticsHubService/UpdateListing",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "UpdateListing",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a listing.
        pub async fn delete_listing(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteListingRequest>,
        ) -> 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.bigquery.analyticshub.v1.AnalyticsHubService/DeleteListing",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "DeleteListing",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Subscribes to a listing.
        ///
        /// Currently, with Analytics Hub, you can create listings that
        /// reference only BigQuery datasets.
        /// Upon subscription to a listing for a BigQuery dataset, Analytics Hub
        /// creates a linked dataset in the subscriber's project.
        pub async fn subscribe_listing(
            &mut self,
            request: impl tonic::IntoRequest<super::SubscribeListingRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SubscribeListingResponse>,
            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.bigquery.analyticshub.v1.AnalyticsHubService/SubscribeListing",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "SubscribeListing",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Creates a Subscription to a Data Clean Room. This is a
        /// long-running operation as it will create one or more linked datasets.
        /// Throws a Bad Request error if the Data Exchange does not contain any
        /// listings.
        pub async fn subscribe_data_exchange(
            &mut self,
            request: impl tonic::IntoRequest<super::SubscribeDataExchangeRequest>,
        ) -> std::result::Result<
            tonic::Response<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.bigquery.analyticshub.v1.AnalyticsHubService/SubscribeDataExchange",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "SubscribeDataExchange",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Refreshes a Subscription to a Data Exchange. A Data Exchange can become
        /// stale when a publisher adds or removes data. This is a long-running
        /// operation as it may create many linked datasets.
        pub async fn refresh_subscription(
            &mut self,
            request: impl tonic::IntoRequest<super::RefreshSubscriptionRequest>,
        ) -> std::result::Result<
            tonic::Response<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.bigquery.analyticshub.v1.AnalyticsHubService/RefreshSubscription",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "RefreshSubscription",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets the details of a Subscription.
        pub async fn get_subscription(
            &mut self,
            request: impl tonic::IntoRequest<super::GetSubscriptionRequest>,
        ) -> std::result::Result<tonic::Response<super::Subscription>, 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.bigquery.analyticshub.v1.AnalyticsHubService/GetSubscription",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "GetSubscription",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists all subscriptions in a given project and location.
        pub async fn list_subscriptions(
            &mut self,
            request: impl tonic::IntoRequest<super::ListSubscriptionsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListSubscriptionsResponse>,
            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.bigquery.analyticshub.v1.AnalyticsHubService/ListSubscriptions",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "ListSubscriptions",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists all subscriptions on a given Data Exchange or Listing.
        pub async fn list_shared_resource_subscriptions(
            &mut self,
            request: impl tonic::IntoRequest<
                super::ListSharedResourceSubscriptionsRequest,
            >,
        ) -> std::result::Result<
            tonic::Response<super::ListSharedResourceSubscriptionsResponse>,
            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.bigquery.analyticshub.v1.AnalyticsHubService/ListSharedResourceSubscriptions",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "ListSharedResourceSubscriptions",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Revokes a given subscription.
        pub async fn revoke_subscription(
            &mut self,
            request: impl tonic::IntoRequest<super::RevokeSubscriptionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::RevokeSubscriptionResponse>,
            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.bigquery.analyticshub.v1.AnalyticsHubService/RevokeSubscription",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "RevokeSubscription",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a subscription.
        pub async fn delete_subscription(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteSubscriptionRequest>,
        ) -> std::result::Result<
            tonic::Response<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.bigquery.analyticshub.v1.AnalyticsHubService/DeleteSubscription",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "DeleteSubscription",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets the IAM policy.
        pub async fn get_iam_policy(
            &mut self,
            request: impl tonic::IntoRequest<
                super::super::super::super::super::iam::v1::GetIamPolicyRequest,
            >,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::super::iam::v1::Policy>,
            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.bigquery.analyticshub.v1.AnalyticsHubService/GetIamPolicy",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "GetIamPolicy",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Sets the IAM policy.
        pub async fn set_iam_policy(
            &mut self,
            request: impl tonic::IntoRequest<
                super::super::super::super::super::iam::v1::SetIamPolicyRequest,
            >,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::super::iam::v1::Policy>,
            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.bigquery.analyticshub.v1.AnalyticsHubService/SetIamPolicy",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "SetIamPolicy",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Returns the permissions that a caller has.
        pub async fn test_iam_permissions(
            &mut self,
            request: impl tonic::IntoRequest<
                super::super::super::super::super::iam::v1::TestIamPermissionsRequest,
            >,
        ) -> std::result::Result<
            tonic::Response<
                super::super::super::super::super::iam::v1::TestIamPermissionsResponse,
            >,
            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.bigquery.analyticshub.v1.AnalyticsHubService/TestIamPermissions",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "TestIamPermissions",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Creates a new QueryTemplate
        pub async fn create_query_template(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateQueryTemplateRequest>,
        ) -> std::result::Result<tonic::Response<super::QueryTemplate>, 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.bigquery.analyticshub.v1.AnalyticsHubService/CreateQueryTemplate",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "CreateQueryTemplate",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets a QueryTemplate
        pub async fn get_query_template(
            &mut self,
            request: impl tonic::IntoRequest<super::GetQueryTemplateRequest>,
        ) -> std::result::Result<tonic::Response<super::QueryTemplate>, 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.bigquery.analyticshub.v1.AnalyticsHubService/GetQueryTemplate",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "GetQueryTemplate",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists all QueryTemplates in a given project and location.
        pub async fn list_query_templates(
            &mut self,
            request: impl tonic::IntoRequest<super::ListQueryTemplatesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListQueryTemplatesResponse>,
            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.bigquery.analyticshub.v1.AnalyticsHubService/ListQueryTemplates",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "ListQueryTemplates",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates an existing QueryTemplate
        pub async fn update_query_template(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateQueryTemplateRequest>,
        ) -> std::result::Result<tonic::Response<super::QueryTemplate>, 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.bigquery.analyticshub.v1.AnalyticsHubService/UpdateQueryTemplate",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "UpdateQueryTemplate",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a query template.
        pub async fn delete_query_template(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteQueryTemplateRequest>,
        ) -> 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.bigquery.analyticshub.v1.AnalyticsHubService/DeleteQueryTemplate",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "DeleteQueryTemplate",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Submits a query template for approval.
        pub async fn submit_query_template(
            &mut self,
            request: impl tonic::IntoRequest<super::SubmitQueryTemplateRequest>,
        ) -> std::result::Result<tonic::Response<super::QueryTemplate>, 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.bigquery.analyticshub.v1.AnalyticsHubService/SubmitQueryTemplate",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "SubmitQueryTemplate",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Approves a query template.
        pub async fn approve_query_template(
            &mut self,
            request: impl tonic::IntoRequest<super::ApproveQueryTemplateRequest>,
        ) -> std::result::Result<tonic::Response<super::QueryTemplate>, 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.bigquery.analyticshub.v1.AnalyticsHubService/ApproveQueryTemplate",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.bigquery.analyticshub.v1.AnalyticsHubService",
                        "ApproveQueryTemplate",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
