mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
make regen-apis
This commit is contained in:
File diff suppressed because it is too large
Load Diff
607
gen/pubsub1/src/api/enums.rs
Normal file
607
gen/pubsub1/src/api/enums.rs
Normal file
@@ -0,0 +1,607 @@
|
||||
use super::*;
|
||||
|
||||
|
||||
|
||||
// region AwsKinesiStateEnum
|
||||
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
|
||||
/// Output only. An output-only field that indicates the state of the Kinesis ingestion source.
|
||||
pub enum AwsKinesiStateEnum {
|
||||
|
||||
|
||||
/// Default value. This value is unused.
|
||||
///
|
||||
/// "STATE_UNSPECIFIED"
|
||||
#[serde(rename="STATE_UNSPECIFIED")]
|
||||
STATEUNSPECIFIED,
|
||||
|
||||
|
||||
/// Ingestion is active.
|
||||
///
|
||||
/// "ACTIVE"
|
||||
#[serde(rename="ACTIVE")]
|
||||
ACTIVE,
|
||||
|
||||
|
||||
/// Permission denied encountered while consuming data from Kinesis. This can happen if: - The provided `aws_role_arn` does not exist or does not have the appropriate permissions attached. - The provided `aws_role_arn` is not set up properly for Identity Federation using `gcp_service_account`. - The Pub/Sub SA is not granted the `iam.serviceAccounts.getOpenIdToken` permission on `gcp_service_account`.
|
||||
///
|
||||
/// "KINESIS_PERMISSION_DENIED"
|
||||
#[serde(rename="KINESIS_PERMISSION_DENIED")]
|
||||
KINESISPERMISSIONDENIED,
|
||||
|
||||
|
||||
/// Permission denied encountered while publishing to the topic. This can happen if the Pub/Sub SA has not been granted the [appropriate publish permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher)
|
||||
///
|
||||
/// "PUBLISH_PERMISSION_DENIED"
|
||||
#[serde(rename="PUBLISH_PERMISSION_DENIED")]
|
||||
PUBLISHPERMISSIONDENIED,
|
||||
|
||||
|
||||
/// The Kinesis stream does not exist.
|
||||
///
|
||||
/// "STREAM_NOT_FOUND"
|
||||
#[serde(rename="STREAM_NOT_FOUND")]
|
||||
STREAMNOTFOUND,
|
||||
|
||||
|
||||
/// The Kinesis consumer does not exist.
|
||||
///
|
||||
/// "CONSUMER_NOT_FOUND"
|
||||
#[serde(rename="CONSUMER_NOT_FOUND")]
|
||||
CONSUMERNOTFOUND,
|
||||
}
|
||||
|
||||
impl AsRef<str> for AwsKinesiStateEnum {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
AwsKinesiStateEnum::STATEUNSPECIFIED => "STATE_UNSPECIFIED",
|
||||
AwsKinesiStateEnum::ACTIVE => "ACTIVE",
|
||||
AwsKinesiStateEnum::KINESISPERMISSIONDENIED => "KINESIS_PERMISSION_DENIED",
|
||||
AwsKinesiStateEnum::PUBLISHPERMISSIONDENIED => "PUBLISH_PERMISSION_DENIED",
|
||||
AwsKinesiStateEnum::STREAMNOTFOUND => "STREAM_NOT_FOUND",
|
||||
AwsKinesiStateEnum::CONSUMERNOTFOUND => "CONSUMER_NOT_FOUND",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::TryFrom< &str> for AwsKinesiStateEnum {
|
||||
type Error = ();
|
||||
fn try_from(value: &str) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
"STATE_UNSPECIFIED" => Ok(AwsKinesiStateEnum::STATEUNSPECIFIED),
|
||||
"ACTIVE" => Ok(AwsKinesiStateEnum::ACTIVE),
|
||||
"KINESIS_PERMISSION_DENIED" => Ok(AwsKinesiStateEnum::KINESISPERMISSIONDENIED),
|
||||
"PUBLISH_PERMISSION_DENIED" => Ok(AwsKinesiStateEnum::PUBLISHPERMISSIONDENIED),
|
||||
"STREAM_NOT_FOUND" => Ok(AwsKinesiStateEnum::STREAMNOTFOUND),
|
||||
"CONSUMER_NOT_FOUND" => Ok(AwsKinesiStateEnum::CONSUMERNOTFOUND),
|
||||
_=> Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a AwsKinesiStateEnum {
|
||||
fn into(self) -> std::borrow::Cow<'a, str> {
|
||||
self.as_ref().into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// endregion
|
||||
|
||||
|
||||
// region BigQueryConfigStateEnum
|
||||
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
|
||||
/// Output only. An output-only field that indicates whether or not the subscription can receive messages.
|
||||
pub enum BigQueryConfigStateEnum {
|
||||
|
||||
|
||||
/// Default value. This value is unused.
|
||||
///
|
||||
/// "STATE_UNSPECIFIED"
|
||||
#[serde(rename="STATE_UNSPECIFIED")]
|
||||
STATEUNSPECIFIED,
|
||||
|
||||
|
||||
/// The subscription can actively send messages to BigQuery
|
||||
///
|
||||
/// "ACTIVE"
|
||||
#[serde(rename="ACTIVE")]
|
||||
ACTIVE,
|
||||
|
||||
|
||||
/// Cannot write to the BigQuery table because of permission denied errors. This can happen if - Pub/Sub SA has not been granted the [appropriate BigQuery IAM permissions](https://cloud.google.com/pubsub/docs/create-subscription#assign_bigquery_service_account) - bigquery.googleapis.com API is not enabled for the project ([instructions](https://cloud.google.com/service-usage/docs/enable-disable))
|
||||
///
|
||||
/// "PERMISSION_DENIED"
|
||||
#[serde(rename="PERMISSION_DENIED")]
|
||||
PERMISSIONDENIED,
|
||||
|
||||
|
||||
/// Cannot write to the BigQuery table because it does not exist.
|
||||
///
|
||||
/// "NOT_FOUND"
|
||||
#[serde(rename="NOT_FOUND")]
|
||||
NOTFOUND,
|
||||
|
||||
|
||||
/// Cannot write to the BigQuery table due to a schema mismatch.
|
||||
///
|
||||
/// "SCHEMA_MISMATCH"
|
||||
#[serde(rename="SCHEMA_MISMATCH")]
|
||||
SCHEMAMISMATCH,
|
||||
|
||||
|
||||
/// Cannot write to the destination because enforce_in_transit is set to true and the destination locations are not in the allowed regions.
|
||||
///
|
||||
/// "IN_TRANSIT_LOCATION_RESTRICTION"
|
||||
#[serde(rename="IN_TRANSIT_LOCATION_RESTRICTION")]
|
||||
INTRANSITLOCATIONRESTRICTION,
|
||||
}
|
||||
|
||||
impl AsRef<str> for BigQueryConfigStateEnum {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
BigQueryConfigStateEnum::STATEUNSPECIFIED => "STATE_UNSPECIFIED",
|
||||
BigQueryConfigStateEnum::ACTIVE => "ACTIVE",
|
||||
BigQueryConfigStateEnum::PERMISSIONDENIED => "PERMISSION_DENIED",
|
||||
BigQueryConfigStateEnum::NOTFOUND => "NOT_FOUND",
|
||||
BigQueryConfigStateEnum::SCHEMAMISMATCH => "SCHEMA_MISMATCH",
|
||||
BigQueryConfigStateEnum::INTRANSITLOCATIONRESTRICTION => "IN_TRANSIT_LOCATION_RESTRICTION",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::TryFrom< &str> for BigQueryConfigStateEnum {
|
||||
type Error = ();
|
||||
fn try_from(value: &str) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
"STATE_UNSPECIFIED" => Ok(BigQueryConfigStateEnum::STATEUNSPECIFIED),
|
||||
"ACTIVE" => Ok(BigQueryConfigStateEnum::ACTIVE),
|
||||
"PERMISSION_DENIED" => Ok(BigQueryConfigStateEnum::PERMISSIONDENIED),
|
||||
"NOT_FOUND" => Ok(BigQueryConfigStateEnum::NOTFOUND),
|
||||
"SCHEMA_MISMATCH" => Ok(BigQueryConfigStateEnum::SCHEMAMISMATCH),
|
||||
"IN_TRANSIT_LOCATION_RESTRICTION" => Ok(BigQueryConfigStateEnum::INTRANSITLOCATIONRESTRICTION),
|
||||
_=> Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a BigQueryConfigStateEnum {
|
||||
fn into(self) -> std::borrow::Cow<'a, str> {
|
||||
self.as_ref().into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// endregion
|
||||
|
||||
|
||||
// region CloudStorageConfigStateEnum
|
||||
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
|
||||
/// Output only. An output-only field that indicates whether or not the subscription can receive messages.
|
||||
pub enum CloudStorageConfigStateEnum {
|
||||
|
||||
|
||||
/// Default value. This value is unused.
|
||||
///
|
||||
/// "STATE_UNSPECIFIED"
|
||||
#[serde(rename="STATE_UNSPECIFIED")]
|
||||
STATEUNSPECIFIED,
|
||||
|
||||
|
||||
/// The subscription can actively send messages to Cloud Storage.
|
||||
///
|
||||
/// "ACTIVE"
|
||||
#[serde(rename="ACTIVE")]
|
||||
ACTIVE,
|
||||
|
||||
|
||||
/// Cannot write to the Cloud Storage bucket because of permission denied errors.
|
||||
///
|
||||
/// "PERMISSION_DENIED"
|
||||
#[serde(rename="PERMISSION_DENIED")]
|
||||
PERMISSIONDENIED,
|
||||
|
||||
|
||||
/// Cannot write to the Cloud Storage bucket because it does not exist.
|
||||
///
|
||||
/// "NOT_FOUND"
|
||||
#[serde(rename="NOT_FOUND")]
|
||||
NOTFOUND,
|
||||
|
||||
|
||||
/// Cannot write to the destination because enforce_in_transit is set to true and the destination locations are not in the allowed regions.
|
||||
///
|
||||
/// "IN_TRANSIT_LOCATION_RESTRICTION"
|
||||
#[serde(rename="IN_TRANSIT_LOCATION_RESTRICTION")]
|
||||
INTRANSITLOCATIONRESTRICTION,
|
||||
}
|
||||
|
||||
impl AsRef<str> for CloudStorageConfigStateEnum {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
CloudStorageConfigStateEnum::STATEUNSPECIFIED => "STATE_UNSPECIFIED",
|
||||
CloudStorageConfigStateEnum::ACTIVE => "ACTIVE",
|
||||
CloudStorageConfigStateEnum::PERMISSIONDENIED => "PERMISSION_DENIED",
|
||||
CloudStorageConfigStateEnum::NOTFOUND => "NOT_FOUND",
|
||||
CloudStorageConfigStateEnum::INTRANSITLOCATIONRESTRICTION => "IN_TRANSIT_LOCATION_RESTRICTION",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::TryFrom< &str> for CloudStorageConfigStateEnum {
|
||||
type Error = ();
|
||||
fn try_from(value: &str) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
"STATE_UNSPECIFIED" => Ok(CloudStorageConfigStateEnum::STATEUNSPECIFIED),
|
||||
"ACTIVE" => Ok(CloudStorageConfigStateEnum::ACTIVE),
|
||||
"PERMISSION_DENIED" => Ok(CloudStorageConfigStateEnum::PERMISSIONDENIED),
|
||||
"NOT_FOUND" => Ok(CloudStorageConfigStateEnum::NOTFOUND),
|
||||
"IN_TRANSIT_LOCATION_RESTRICTION" => Ok(CloudStorageConfigStateEnum::INTRANSITLOCATIONRESTRICTION),
|
||||
_=> Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a CloudStorageConfigStateEnum {
|
||||
fn into(self) -> std::borrow::Cow<'a, str> {
|
||||
self.as_ref().into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// endregion
|
||||
|
||||
|
||||
// region SchemaTypeEnum
|
||||
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
|
||||
/// The type of the schema definition.
|
||||
pub enum SchemaTypeEnum {
|
||||
|
||||
|
||||
/// Default value. This value is unused.
|
||||
///
|
||||
/// "TYPE_UNSPECIFIED"
|
||||
#[serde(rename="TYPE_UNSPECIFIED")]
|
||||
TYPEUNSPECIFIED,
|
||||
|
||||
|
||||
/// A Protocol Buffer schema definition.
|
||||
///
|
||||
/// "PROTOCOL_BUFFER"
|
||||
#[serde(rename="PROTOCOL_BUFFER")]
|
||||
PROTOCOLBUFFER,
|
||||
|
||||
|
||||
/// An Avro schema definition.
|
||||
///
|
||||
/// "AVRO"
|
||||
#[serde(rename="AVRO")]
|
||||
AVRO,
|
||||
}
|
||||
|
||||
impl AsRef<str> for SchemaTypeEnum {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
SchemaTypeEnum::TYPEUNSPECIFIED => "TYPE_UNSPECIFIED",
|
||||
SchemaTypeEnum::PROTOCOLBUFFER => "PROTOCOL_BUFFER",
|
||||
SchemaTypeEnum::AVRO => "AVRO",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::TryFrom< &str> for SchemaTypeEnum {
|
||||
type Error = ();
|
||||
fn try_from(value: &str) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
"TYPE_UNSPECIFIED" => Ok(SchemaTypeEnum::TYPEUNSPECIFIED),
|
||||
"PROTOCOL_BUFFER" => Ok(SchemaTypeEnum::PROTOCOLBUFFER),
|
||||
"AVRO" => Ok(SchemaTypeEnum::AVRO),
|
||||
_=> Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a SchemaTypeEnum {
|
||||
fn into(self) -> std::borrow::Cow<'a, str> {
|
||||
self.as_ref().into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// endregion
|
||||
|
||||
|
||||
// region SchemaSettingEncodingEnum
|
||||
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
|
||||
/// Optional. The encoding of messages validated against `schema`.
|
||||
pub enum SchemaSettingEncodingEnum {
|
||||
|
||||
|
||||
/// Unspecified
|
||||
///
|
||||
/// "ENCODING_UNSPECIFIED"
|
||||
#[serde(rename="ENCODING_UNSPECIFIED")]
|
||||
ENCODINGUNSPECIFIED,
|
||||
|
||||
|
||||
/// JSON encoding
|
||||
///
|
||||
/// "JSON"
|
||||
#[serde(rename="JSON")]
|
||||
JSON,
|
||||
|
||||
|
||||
/// Binary encoding, as defined by the schema type. For some schema types, binary encoding may not be available.
|
||||
///
|
||||
/// "BINARY"
|
||||
#[serde(rename="BINARY")]
|
||||
BINARY,
|
||||
}
|
||||
|
||||
impl AsRef<str> for SchemaSettingEncodingEnum {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
SchemaSettingEncodingEnum::ENCODINGUNSPECIFIED => "ENCODING_UNSPECIFIED",
|
||||
SchemaSettingEncodingEnum::JSON => "JSON",
|
||||
SchemaSettingEncodingEnum::BINARY => "BINARY",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::TryFrom< &str> for SchemaSettingEncodingEnum {
|
||||
type Error = ();
|
||||
fn try_from(value: &str) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
"ENCODING_UNSPECIFIED" => Ok(SchemaSettingEncodingEnum::ENCODINGUNSPECIFIED),
|
||||
"JSON" => Ok(SchemaSettingEncodingEnum::JSON),
|
||||
"BINARY" => Ok(SchemaSettingEncodingEnum::BINARY),
|
||||
_=> Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a SchemaSettingEncodingEnum {
|
||||
fn into(self) -> std::borrow::Cow<'a, str> {
|
||||
self.as_ref().into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// endregion
|
||||
|
||||
|
||||
// region SubscriptionStateEnum
|
||||
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
|
||||
/// Output only. An output-only field indicating whether or not the subscription can receive messages.
|
||||
pub enum SubscriptionStateEnum {
|
||||
|
||||
|
||||
/// Default value. This value is unused.
|
||||
///
|
||||
/// "STATE_UNSPECIFIED"
|
||||
#[serde(rename="STATE_UNSPECIFIED")]
|
||||
STATEUNSPECIFIED,
|
||||
|
||||
|
||||
/// The subscription can actively receive messages
|
||||
///
|
||||
/// "ACTIVE"
|
||||
#[serde(rename="ACTIVE")]
|
||||
ACTIVE,
|
||||
|
||||
|
||||
/// The subscription cannot receive messages because of an error with the resource to which it pushes messages. See the more detailed error state in the corresponding configuration.
|
||||
///
|
||||
/// "RESOURCE_ERROR"
|
||||
#[serde(rename="RESOURCE_ERROR")]
|
||||
RESOURCEERROR,
|
||||
}
|
||||
|
||||
impl AsRef<str> for SubscriptionStateEnum {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
SubscriptionStateEnum::STATEUNSPECIFIED => "STATE_UNSPECIFIED",
|
||||
SubscriptionStateEnum::ACTIVE => "ACTIVE",
|
||||
SubscriptionStateEnum::RESOURCEERROR => "RESOURCE_ERROR",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::TryFrom< &str> for SubscriptionStateEnum {
|
||||
type Error = ();
|
||||
fn try_from(value: &str) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
"STATE_UNSPECIFIED" => Ok(SubscriptionStateEnum::STATEUNSPECIFIED),
|
||||
"ACTIVE" => Ok(SubscriptionStateEnum::ACTIVE),
|
||||
"RESOURCE_ERROR" => Ok(SubscriptionStateEnum::RESOURCEERROR),
|
||||
_=> Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a SubscriptionStateEnum {
|
||||
fn into(self) -> std::borrow::Cow<'a, str> {
|
||||
self.as_ref().into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// endregion
|
||||
|
||||
|
||||
// region TopicStateEnum
|
||||
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
|
||||
/// Output only. An output-only field indicating the state of the topic.
|
||||
pub enum TopicStateEnum {
|
||||
|
||||
|
||||
/// Default value. This value is unused.
|
||||
///
|
||||
/// "STATE_UNSPECIFIED"
|
||||
#[serde(rename="STATE_UNSPECIFIED")]
|
||||
STATEUNSPECIFIED,
|
||||
|
||||
|
||||
/// The topic does not have any persistent errors.
|
||||
///
|
||||
/// "ACTIVE"
|
||||
#[serde(rename="ACTIVE")]
|
||||
ACTIVE,
|
||||
|
||||
|
||||
/// Ingestion from the data source has encountered a permanent error. See the more detailed error state in the corresponding ingestion source configuration.
|
||||
///
|
||||
/// "INGESTION_RESOURCE_ERROR"
|
||||
#[serde(rename="INGESTION_RESOURCE_ERROR")]
|
||||
INGESTIONRESOURCEERROR,
|
||||
}
|
||||
|
||||
impl AsRef<str> for TopicStateEnum {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
TopicStateEnum::STATEUNSPECIFIED => "STATE_UNSPECIFIED",
|
||||
TopicStateEnum::ACTIVE => "ACTIVE",
|
||||
TopicStateEnum::INGESTIONRESOURCEERROR => "INGESTION_RESOURCE_ERROR",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::TryFrom< &str> for TopicStateEnum {
|
||||
type Error = ();
|
||||
fn try_from(value: &str) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
"STATE_UNSPECIFIED" => Ok(TopicStateEnum::STATEUNSPECIFIED),
|
||||
"ACTIVE" => Ok(TopicStateEnum::ACTIVE),
|
||||
"INGESTION_RESOURCE_ERROR" => Ok(TopicStateEnum::INGESTIONRESOURCEERROR),
|
||||
_=> Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a TopicStateEnum {
|
||||
fn into(self) -> std::borrow::Cow<'a, str> {
|
||||
self.as_ref().into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// endregion
|
||||
|
||||
|
||||
// region ValidateMessageRequestEncodingEnum
|
||||
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
|
||||
/// The encoding expected for messages
|
||||
pub enum ValidateMessageRequestEncodingEnum {
|
||||
|
||||
|
||||
/// Unspecified
|
||||
///
|
||||
/// "ENCODING_UNSPECIFIED"
|
||||
#[serde(rename="ENCODING_UNSPECIFIED")]
|
||||
ENCODINGUNSPECIFIED,
|
||||
|
||||
|
||||
/// JSON encoding
|
||||
///
|
||||
/// "JSON"
|
||||
#[serde(rename="JSON")]
|
||||
JSON,
|
||||
|
||||
|
||||
/// Binary encoding, as defined by the schema type. For some schema types, binary encoding may not be available.
|
||||
///
|
||||
/// "BINARY"
|
||||
#[serde(rename="BINARY")]
|
||||
BINARY,
|
||||
}
|
||||
|
||||
impl AsRef<str> for ValidateMessageRequestEncodingEnum {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
ValidateMessageRequestEncodingEnum::ENCODINGUNSPECIFIED => "ENCODING_UNSPECIFIED",
|
||||
ValidateMessageRequestEncodingEnum::JSON => "JSON",
|
||||
ValidateMessageRequestEncodingEnum::BINARY => "BINARY",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::TryFrom< &str> for ValidateMessageRequestEncodingEnum {
|
||||
type Error = ();
|
||||
fn try_from(value: &str) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
"ENCODING_UNSPECIFIED" => Ok(ValidateMessageRequestEncodingEnum::ENCODINGUNSPECIFIED),
|
||||
"JSON" => Ok(ValidateMessageRequestEncodingEnum::JSON),
|
||||
"BINARY" => Ok(ValidateMessageRequestEncodingEnum::BINARY),
|
||||
_=> Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a ValidateMessageRequestEncodingEnum {
|
||||
fn into(self) -> std::borrow::Cow<'a, str> {
|
||||
self.as_ref().into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// endregion
|
||||
|
||||
|
||||
// region ProjectViewEnum
|
||||
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
|
||||
/// The set of Schema fields to return in the response. If not set, returns Schemas with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all fields.
|
||||
pub enum ProjectViewEnum {
|
||||
|
||||
|
||||
/// The default / unset value. The API will default to the BASIC view.
|
||||
///
|
||||
/// "SCHEMA_VIEW_UNSPECIFIED"
|
||||
#[serde(rename="SCHEMA_VIEW_UNSPECIFIED")]
|
||||
SCHEMAVIEWUNSPECIFIED,
|
||||
|
||||
|
||||
/// Include the name and type of the schema, but not the definition.
|
||||
///
|
||||
/// "BASIC"
|
||||
#[serde(rename="BASIC")]
|
||||
BASIC,
|
||||
|
||||
|
||||
/// Include all Schema object fields.
|
||||
///
|
||||
/// "FULL"
|
||||
#[serde(rename="FULL")]
|
||||
FULL,
|
||||
}
|
||||
|
||||
impl AsRef<str> for ProjectViewEnum {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
ProjectViewEnum::SCHEMAVIEWUNSPECIFIED => "SCHEMA_VIEW_UNSPECIFIED",
|
||||
ProjectViewEnum::BASIC => "BASIC",
|
||||
ProjectViewEnum::FULL => "FULL",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::TryFrom< &str> for ProjectViewEnum {
|
||||
type Error = ();
|
||||
fn try_from(value: &str) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
"SCHEMA_VIEW_UNSPECIFIED" => Ok(ProjectViewEnum::SCHEMAVIEWUNSPECIFIED),
|
||||
"BASIC" => Ok(ProjectViewEnum::BASIC),
|
||||
"FULL" => Ok(ProjectViewEnum::FULL),
|
||||
_=> Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a ProjectViewEnum {
|
||||
fn into(self) -> std::borrow::Cow<'a, str> {
|
||||
self.as_ref().into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// endregion
|
||||
|
||||
|
||||
108
gen/pubsub1/src/api/hub.rs
Normal file
108
gen/pubsub1/src/api/hub.rs
Normal file
@@ -0,0 +1,108 @@
|
||||
use super::*;
|
||||
|
||||
/// Central instance to access all Pubsub related resource activities
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Instantiate a new hub
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_pubsub1 as pubsub1;
|
||||
/// use pubsub1::{Result, Error};
|
||||
/// use pubsub1::api::enums::*;
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use pubsub1::{Pubsub, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
|
||||
/// // `client_secret`, among other things.
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// // Instantiate the authenticator. It will choose a suitable authentication flow for you,
|
||||
/// // unless you replace `None` with the desired Flow.
|
||||
/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
|
||||
/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
|
||||
/// // retrieve them from storage.
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = Pubsub::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
/// // execute the final call using `doit()`.
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let result = hub.projects().schemas_get_iam_policy("resource")
|
||||
/// .options_requested_policy_version(-27)
|
||||
/// .doit().await;
|
||||
///
|
||||
/// match result {
|
||||
/// Err(e) => match e {
|
||||
/// // The Error enum provides details about what exactly happened.
|
||||
/// // You can also just use its `Debug`, `Display` or `Error` traits
|
||||
/// Error::HttpError(_)
|
||||
/// |Error::Io(_)
|
||||
/// |Error::MissingAPIKey
|
||||
/// |Error::MissingToken(_)
|
||||
/// |Error::Cancelled
|
||||
/// |Error::UploadSizeLimitExceeded(_, _)
|
||||
/// |Error::Failure(_)
|
||||
/// |Error::BadRequest(_)
|
||||
/// |Error::FieldClash(_)
|
||||
/// |Error::JsonDecodeError(_, _) => println!("{}", e),
|
||||
/// },
|
||||
/// Ok(res) => println!("Success: {:?}", res),
|
||||
/// }
|
||||
/// # }
|
||||
/// ```
|
||||
#[derive(Clone)]
|
||||
pub struct Pubsub<S> {
|
||||
pub client: hyper::Client<S, hyper::body::Body>,
|
||||
pub auth: Box<dyn client::GetToken>,
|
||||
pub(super) _user_agent: String,
|
||||
pub(super) _base_url: String,
|
||||
pub(super) _root_url: String,
|
||||
}
|
||||
|
||||
impl<'a, S> client::Hub for Pubsub<S> {}
|
||||
|
||||
impl<'a, S> Pubsub<S> {
|
||||
|
||||
pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> Pubsub<S> {
|
||||
Pubsub {
|
||||
client,
|
||||
auth: Box::new(auth),
|
||||
_user_agent: "google-api-rust-client/5.0.5".to_string(),
|
||||
_base_url: "https://pubsub.googleapis.com/".to_string(),
|
||||
_root_url: "https://pubsub.googleapis.com/".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn projects(&'a self) -> ProjectMethods<'a, S> {
|
||||
ProjectMethods { hub: &self }
|
||||
}
|
||||
|
||||
/// Set the user-agent header field to use in all requests to the server.
|
||||
/// It defaults to `google-api-rust-client/5.0.5`.
|
||||
///
|
||||
/// Returns the previously set user-agent.
|
||||
pub fn user_agent(&mut self, agent_name: String) -> String {
|
||||
mem::replace(&mut self._user_agent, agent_name)
|
||||
}
|
||||
|
||||
/// Set the base url to use in all requests to the server.
|
||||
/// It defaults to `https://pubsub.googleapis.com/`.
|
||||
///
|
||||
/// Returns the previously set base url.
|
||||
pub fn base_url(&mut self, new_base_url: String) -> String {
|
||||
mem::replace(&mut self._base_url, new_base_url)
|
||||
}
|
||||
|
||||
/// Set the root url to use in all requests to the server.
|
||||
/// It defaults to `https://pubsub.googleapis.com/`.
|
||||
///
|
||||
/// Returns the previously set root url.
|
||||
pub fn root_url(&mut self, new_root_url: String) -> String {
|
||||
mem::replace(&mut self._root_url, new_root_url)
|
||||
}
|
||||
}
|
||||
897
gen/pubsub1/src/api/method_builders.rs
Normal file
897
gen/pubsub1/src/api/method_builders.rs
Normal file
@@ -0,0 +1,897 @@
|
||||
use super::*;
|
||||
/// A builder providing access to all methods supported on *project* resources.
|
||||
/// It is not used directly, but through the [`Pubsub`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_pubsub1 as pubsub1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use pubsub1::{Pubsub, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = Pubsub::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `schemas_commit(...)`, `schemas_create(...)`, `schemas_delete(...)`, `schemas_delete_revision(...)`, `schemas_get(...)`, `schemas_get_iam_policy(...)`, `schemas_list(...)`, `schemas_list_revisions(...)`, `schemas_rollback(...)`, `schemas_set_iam_policy(...)`, `schemas_test_iam_permissions(...)`, `schemas_validate(...)`, `schemas_validate_message(...)`, `snapshots_create(...)`, `snapshots_delete(...)`, `snapshots_get(...)`, `snapshots_get_iam_policy(...)`, `snapshots_list(...)`, `snapshots_patch(...)`, `snapshots_set_iam_policy(...)`, `snapshots_test_iam_permissions(...)`, `subscriptions_acknowledge(...)`, `subscriptions_create(...)`, `subscriptions_delete(...)`, `subscriptions_detach(...)`, `subscriptions_get(...)`, `subscriptions_get_iam_policy(...)`, `subscriptions_list(...)`, `subscriptions_modify_ack_deadline(...)`, `subscriptions_modify_push_config(...)`, `subscriptions_patch(...)`, `subscriptions_pull(...)`, `subscriptions_seek(...)`, `subscriptions_set_iam_policy(...)`, `subscriptions_test_iam_permissions(...)`, `topics_create(...)`, `topics_delete(...)`, `topics_get(...)`, `topics_get_iam_policy(...)`, `topics_list(...)`, `topics_patch(...)`, `topics_publish(...)`, `topics_set_iam_policy(...)`, `topics_snapshots_list(...)`, `topics_subscriptions_list(...)` and `topics_test_iam_permissions(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.projects();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct ProjectMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a Pubsub<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for ProjectMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> ProjectMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Commits a new schema revision to an existing schema.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Required. The name of the schema we are revising. Format is `projects/{project}/schemas/{schema}`.
|
||||
pub fn schemas_commit(&self, request: CommitSchemaRequest, name: &str) -> ProjectSchemaCommitCall<'a, S> {
|
||||
ProjectSchemaCommitCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Creates a schema.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `parent` - Required. The name of the project in which to create the schema. Format is `projects/{project-id}`.
|
||||
pub fn schemas_create(&self, request: Schema, parent: &str) -> ProjectSchemaCreateCall<'a, S> {
|
||||
ProjectSchemaCreateCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_parent: parent.to_string(),
|
||||
_schema_id: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Deletes a schema.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Required. Name of the schema to delete. Format is `projects/{project}/schemas/{schema}`.
|
||||
pub fn schemas_delete(&self, name: &str) -> ProjectSchemaDeleteCall<'a, S> {
|
||||
ProjectSchemaDeleteCall {
|
||||
hub: self.hub,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Deletes a specific schema revision.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Required. The name of the schema revision to be deleted, with a revision ID explicitly included. Example: `projects/123/schemas/my-schema@c7cfa2a8`
|
||||
pub fn schemas_delete_revision(&self, name: &str) -> ProjectSchemaDeleteRevisionCall<'a, S> {
|
||||
ProjectSchemaDeleteRevisionCall {
|
||||
hub: self.hub,
|
||||
_name: name.to_string(),
|
||||
_revision_id: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets a schema.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Required. The name of the schema to get. Format is `projects/{project}/schemas/{schema}`.
|
||||
pub fn schemas_get(&self, name: &str) -> ProjectSchemaGetCall<'a, S> {
|
||||
ProjectSchemaGetCall {
|
||||
hub: self.hub,
|
||||
_name: name.to_string(),
|
||||
_view: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `resource` - REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn schemas_get_iam_policy(&self, resource: &str) -> ProjectSchemaGetIamPolicyCall<'a, S> {
|
||||
ProjectSchemaGetIamPolicyCall {
|
||||
hub: self.hub,
|
||||
_resource: resource.to_string(),
|
||||
_options_requested_policy_version: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Lists schemas in a project.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `parent` - Required. The name of the project in which to list schemas. Format is `projects/{project-id}`.
|
||||
pub fn schemas_list(&self, parent: &str) -> ProjectSchemaListCall<'a, S> {
|
||||
ProjectSchemaListCall {
|
||||
hub: self.hub,
|
||||
_parent: parent.to_string(),
|
||||
_view: Default::default(),
|
||||
_page_token: Default::default(),
|
||||
_page_size: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Lists all schema revisions for the named schema.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Required. The name of the schema to list revisions for.
|
||||
pub fn schemas_list_revisions(&self, name: &str) -> ProjectSchemaListRevisionCall<'a, S> {
|
||||
ProjectSchemaListRevisionCall {
|
||||
hub: self.hub,
|
||||
_name: name.to_string(),
|
||||
_view: Default::default(),
|
||||
_page_token: Default::default(),
|
||||
_page_size: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Creates a new schema revision that is a copy of the provided revision_id.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Required. The schema being rolled back with revision id.
|
||||
pub fn schemas_rollback(&self, request: RollbackSchemaRequest, name: &str) -> ProjectSchemaRollbackCall<'a, S> {
|
||||
ProjectSchemaRollbackCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn schemas_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectSchemaSetIamPolicyCall<'a, S> {
|
||||
ProjectSchemaSetIamPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn schemas_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectSchemaTestIamPermissionCall<'a, S> {
|
||||
ProjectSchemaTestIamPermissionCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Validates a schema.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `parent` - Required. The name of the project in which to validate schemas. Format is `projects/{project-id}`.
|
||||
pub fn schemas_validate(&self, request: ValidateSchemaRequest, parent: &str) -> ProjectSchemaValidateCall<'a, S> {
|
||||
ProjectSchemaValidateCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_parent: parent.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Validates a message against a schema.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `parent` - Required. The name of the project in which to validate schemas. Format is `projects/{project-id}`.
|
||||
pub fn schemas_validate_message(&self, request: ValidateMessageRequest, parent: &str) -> ProjectSchemaValidateMessageCall<'a, S> {
|
||||
ProjectSchemaValidateMessageCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_parent: parent.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Creates a snapshot from the requested subscription. Snapshots are used in [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. If the snapshot already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the `Snapshot.expire_time` field. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription, conforming to the [resource name format] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The generated name is populated in the returned Snapshot object. Note that for REST API requests, you must specify a name in the request.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Required. User-provided name for this snapshot. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription. Note that for REST API requests, you must specify a name. See the [resource name rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). Format is `projects/{project}/snapshots/{snap}`.
|
||||
pub fn snapshots_create(&self, request: CreateSnapshotRequest, name: &str) -> ProjectSnapshotCreateCall<'a, S> {
|
||||
ProjectSnapshotCreateCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Removes an existing snapshot. Snapshots are used in [Seek] (https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. When the snapshot is deleted, all messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new one may be created with the same name, but the new one has no association with the old snapshot or its subscription, unless the same subscription is specified.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `snapshot` - Required. The name of the snapshot to delete. Format is `projects/{project}/snapshots/{snap}`.
|
||||
pub fn snapshots_delete(&self, snapshot: &str) -> ProjectSnapshotDeleteCall<'a, S> {
|
||||
ProjectSnapshotDeleteCall {
|
||||
hub: self.hub,
|
||||
_snapshot: snapshot.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets the configuration details of a snapshot. Snapshots are used in [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `snapshot` - Required. The name of the snapshot to get. Format is `projects/{project}/snapshots/{snap}`.
|
||||
pub fn snapshots_get(&self, snapshot: &str) -> ProjectSnapshotGetCall<'a, S> {
|
||||
ProjectSnapshotGetCall {
|
||||
hub: self.hub,
|
||||
_snapshot: snapshot.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `resource` - REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn snapshots_get_iam_policy(&self, resource: &str) -> ProjectSnapshotGetIamPolicyCall<'a, S> {
|
||||
ProjectSnapshotGetIamPolicyCall {
|
||||
hub: self.hub,
|
||||
_resource: resource.to_string(),
|
||||
_options_requested_policy_version: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Lists the existing snapshots. Snapshots are used in [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `project` - Required. The name of the project in which to list snapshots. Format is `projects/{project-id}`.
|
||||
pub fn snapshots_list(&self, project: &str) -> ProjectSnapshotListCall<'a, S> {
|
||||
ProjectSnapshotListCall {
|
||||
hub: self.hub,
|
||||
_project: project.to_string(),
|
||||
_page_token: Default::default(),
|
||||
_page_size: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Updates an existing snapshot by updating the fields specified in the update mask. Snapshots are used in [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Optional. The name of the snapshot.
|
||||
pub fn snapshots_patch(&self, request: UpdateSnapshotRequest, name: &str) -> ProjectSnapshotPatchCall<'a, S> {
|
||||
ProjectSnapshotPatchCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn snapshots_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectSnapshotSetIamPolicyCall<'a, S> {
|
||||
ProjectSnapshotSetIamPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn snapshots_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectSnapshotTestIamPermissionCall<'a, S> {
|
||||
ProjectSnapshotTestIamPermissionCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages from the subscription. Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `subscription` - Required. The subscription whose message is being acknowledged. Format is `projects/{project}/subscriptions/{sub}`.
|
||||
pub fn subscriptions_acknowledge(&self, request: AcknowledgeRequest, subscription: &str) -> ProjectSubscriptionAcknowledgeCall<'a, S> {
|
||||
ProjectSubscriptionAcknowledgeCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_subscription: subscription.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Creates a subscription to a given topic. See the [resource name rules] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). If the subscription already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic, conforming to the [resource name format] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The generated name is populated in the returned Subscription object. Note that for REST API requests, you must specify a name in the request.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Required. The name of the subscription. It must have the format `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`.
|
||||
pub fn subscriptions_create(&self, request: Subscription, name: &str) -> ProjectSubscriptionCreateCall<'a, S> {
|
||||
ProjectSubscriptionCreateCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Deletes an existing subscription. All messages retained in the subscription are immediately dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription or its topic unless the same topic is specified.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `subscription` - Required. The subscription to delete. Format is `projects/{project}/subscriptions/{sub}`.
|
||||
pub fn subscriptions_delete(&self, subscription: &str) -> ProjectSubscriptionDeleteCall<'a, S> {
|
||||
ProjectSubscriptionDeleteCall {
|
||||
hub: self.hub,
|
||||
_subscription: subscription.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Detaches a subscription from this topic. All messages retained in the subscription are dropped. Subsequent `Pull` and `StreamingPull` requests will return FAILED_PRECONDITION. If the subscription is a push subscription, pushes to the endpoint will stop.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `subscription` - Required. The subscription to detach. Format is `projects/{project}/subscriptions/{subscription}`.
|
||||
pub fn subscriptions_detach(&self, subscription: &str) -> ProjectSubscriptionDetachCall<'a, S> {
|
||||
ProjectSubscriptionDetachCall {
|
||||
hub: self.hub,
|
||||
_subscription: subscription.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets the configuration details of a subscription.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `subscription` - Required. The name of the subscription to get. Format is `projects/{project}/subscriptions/{sub}`.
|
||||
pub fn subscriptions_get(&self, subscription: &str) -> ProjectSubscriptionGetCall<'a, S> {
|
||||
ProjectSubscriptionGetCall {
|
||||
hub: self.hub,
|
||||
_subscription: subscription.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `resource` - REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn subscriptions_get_iam_policy(&self, resource: &str) -> ProjectSubscriptionGetIamPolicyCall<'a, S> {
|
||||
ProjectSubscriptionGetIamPolicyCall {
|
||||
hub: self.hub,
|
||||
_resource: resource.to_string(),
|
||||
_options_requested_policy_version: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Lists matching subscriptions.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `project` - Required. The name of the project in which to list subscriptions. Format is `projects/{project-id}`.
|
||||
pub fn subscriptions_list(&self, project: &str) -> ProjectSubscriptionListCall<'a, S> {
|
||||
ProjectSubscriptionListCall {
|
||||
hub: self.hub,
|
||||
_project: project.to_string(),
|
||||
_page_token: Default::default(),
|
||||
_page_size: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted. Note that this does not modify the subscription-level `ackDeadlineSeconds` used for subsequent messages.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `subscription` - Required. The name of the subscription. Format is `projects/{project}/subscriptions/{sub}`.
|
||||
pub fn subscriptions_modify_ack_deadline(&self, request: ModifyAckDeadlineRequest, subscription: &str) -> ProjectSubscriptionModifyAckDeadlineCall<'a, S> {
|
||||
ProjectSubscriptionModifyAckDeadlineCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_subscription: subscription.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Modifies the `PushConfig` for a specified subscription. This may be used to change a push subscription to a pull one (signified by an empty `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the `PushConfig`.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `subscription` - Required. The name of the subscription. Format is `projects/{project}/subscriptions/{sub}`.
|
||||
pub fn subscriptions_modify_push_config(&self, request: ModifyPushConfigRequest, subscription: &str) -> ProjectSubscriptionModifyPushConfigCall<'a, S> {
|
||||
ProjectSubscriptionModifyPushConfigCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_subscription: subscription.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Updates an existing subscription by updating the fields specified in the update mask. Note that certain properties of a subscription, such as its topic, are not modifiable.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Required. The name of the subscription. It must have the format `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`.
|
||||
pub fn subscriptions_patch(&self, request: UpdateSubscriptionRequest, name: &str) -> ProjectSubscriptionPatchCall<'a, S> {
|
||||
ProjectSubscriptionPatchCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Pulls messages from the server.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `subscription` - Required. The subscription from which messages should be pulled. Format is `projects/{project}/subscriptions/{sub}`.
|
||||
pub fn subscriptions_pull(&self, request: PullRequest, subscription: &str) -> ProjectSubscriptionPullCall<'a, S> {
|
||||
ProjectSubscriptionPullCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_subscription: subscription.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Seeks an existing subscription to a point in time or to a given snapshot, whichever is provided in the request. Snapshots are used in [Seek] (https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. Note that both the subscription and the snapshot must be on the same topic.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `subscription` - Required. The subscription to affect.
|
||||
pub fn subscriptions_seek(&self, request: SeekRequest, subscription: &str) -> ProjectSubscriptionSeekCall<'a, S> {
|
||||
ProjectSubscriptionSeekCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_subscription: subscription.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn subscriptions_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectSubscriptionSetIamPolicyCall<'a, S> {
|
||||
ProjectSubscriptionSetIamPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn subscriptions_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectSubscriptionTestIamPermissionCall<'a, S> {
|
||||
ProjectSubscriptionTestIamPermissionCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Lists the names of the snapshots on this topic. Snapshots are used in [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `topic` - Required. The name of the topic that snapshots are attached to. Format is `projects/{project}/topics/{topic}`.
|
||||
pub fn topics_snapshots_list(&self, topic: &str) -> ProjectTopicSnapshotListCall<'a, S> {
|
||||
ProjectTopicSnapshotListCall {
|
||||
hub: self.hub,
|
||||
_topic: topic.to_string(),
|
||||
_page_token: Default::default(),
|
||||
_page_size: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Lists the names of the attached subscriptions on this topic.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `topic` - Required. The name of the topic that subscriptions are attached to. Format is `projects/{project}/topics/{topic}`.
|
||||
pub fn topics_subscriptions_list(&self, topic: &str) -> ProjectTopicSubscriptionListCall<'a, S> {
|
||||
ProjectTopicSubscriptionListCall {
|
||||
hub: self.hub,
|
||||
_topic: topic.to_string(),
|
||||
_page_token: Default::default(),
|
||||
_page_size: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Creates the given topic with the given name. See the [resource name rules] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Required. The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`.
|
||||
pub fn topics_create(&self, request: Topic, name: &str) -> ProjectTopicCreateCall<'a, S> {
|
||||
ProjectTopicCreateCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their `topic` field is set to `_deleted-topic_`.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `topic` - Required. Name of the topic to delete. Format is `projects/{project}/topics/{topic}`.
|
||||
pub fn topics_delete(&self, topic: &str) -> ProjectTopicDeleteCall<'a, S> {
|
||||
ProjectTopicDeleteCall {
|
||||
hub: self.hub,
|
||||
_topic: topic.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets the configuration of a topic.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `topic` - Required. The name of the topic to get. Format is `projects/{project}/topics/{topic}`.
|
||||
pub fn topics_get(&self, topic: &str) -> ProjectTopicGetCall<'a, S> {
|
||||
ProjectTopicGetCall {
|
||||
hub: self.hub,
|
||||
_topic: topic.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `resource` - REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn topics_get_iam_policy(&self, resource: &str) -> ProjectTopicGetIamPolicyCall<'a, S> {
|
||||
ProjectTopicGetIamPolicyCall {
|
||||
hub: self.hub,
|
||||
_resource: resource.to_string(),
|
||||
_options_requested_policy_version: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Lists matching topics.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `project` - Required. The name of the project in which to list topics. Format is `projects/{project-id}`.
|
||||
pub fn topics_list(&self, project: &str) -> ProjectTopicListCall<'a, S> {
|
||||
ProjectTopicListCall {
|
||||
hub: self.hub,
|
||||
_project: project.to_string(),
|
||||
_page_token: Default::default(),
|
||||
_page_size: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Updates an existing topic by updating the fields specified in the update mask. Note that certain properties of a topic are not modifiable.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Required. The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`.
|
||||
pub fn topics_patch(&self, request: UpdateTopicRequest, name: &str) -> ProjectTopicPatchCall<'a, S> {
|
||||
ProjectTopicPatchCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `topic` - Required. The messages in the request will be published on this topic. Format is `projects/{project}/topics/{topic}`.
|
||||
pub fn topics_publish(&self, request: PublishRequest, topic: &str) -> ProjectTopicPublishCall<'a, S> {
|
||||
ProjectTopicPublishCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_topic: topic.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn topics_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectTopicSetIamPolicyCall<'a, S> {
|
||||
ProjectTopicSetIamPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn topics_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectTopicTestIamPermissionCall<'a, S> {
|
||||
ProjectTopicTestIamPermissionCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
35
gen/pubsub1/src/api/mod.rs
Normal file
35
gen/pubsub1/src/api/mod.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
use std::collections::HashMap;
|
||||
use std::cell::RefCell;
|
||||
use std::default::Default;
|
||||
use std::collections::BTreeSet;
|
||||
use std::error::Error as StdError;
|
||||
use serde_json as json;
|
||||
use std::io;
|
||||
use std::fs;
|
||||
use std::mem;
|
||||
|
||||
use hyper::client::connect;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use tokio::time::sleep;
|
||||
use tower_service;
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
use crate::{client, client::GetToken, client::serde_with};
|
||||
|
||||
mod utilities;
|
||||
pub use utilities::*;
|
||||
|
||||
mod hub;
|
||||
pub use hub::*;
|
||||
|
||||
mod schemas;
|
||||
pub use schemas::*;
|
||||
|
||||
mod method_builders;
|
||||
pub use method_builders::*;
|
||||
|
||||
mod call_builders;
|
||||
pub use call_builders::*;
|
||||
|
||||
pub mod enums;
|
||||
pub(crate) use enums::*;
|
||||
1343
gen/pubsub1/src/api/schemas.rs
Normal file
1343
gen/pubsub1/src/api/schemas.rs
Normal file
File diff suppressed because it is too large
Load Diff
28
gen/pubsub1/src/api/utilities.rs
Normal file
28
gen/pubsub1/src/api/utilities.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
use super::*;
|
||||
/// Identifies the an OAuth2 authorization scope.
|
||||
/// A scope is needed when requesting an
|
||||
/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication).
|
||||
#[derive(PartialEq, Eq, Hash, Debug, Clone)]
|
||||
pub enum Scope {
|
||||
/// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
||||
CloudPlatform,
|
||||
|
||||
/// View and manage Pub/Sub topics and subscriptions
|
||||
Full,
|
||||
}
|
||||
|
||||
impl AsRef<str> for Scope {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform",
|
||||
Scope::Full => "https://www.googleapis.com/auth/pubsub",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Scope {
|
||||
fn default() -> Scope {
|
||||
Scope::Full
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
|
||||
// DO NOT EDIT !
|
||||
|
||||
//! This documentation was generated from *Pubsub* crate version *5.0.4+20240227*, where *20240227* is the exact revision of the *pubsub:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.4*.
|
||||
//! This documentation was generated from *Pubsub* crate version *5.0.5+20240409*, where *20240409* is the exact revision of the *pubsub:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.5*.
|
||||
//!
|
||||
//! Everything else about the *Pubsub* *v1* API can be found at the
|
||||
//! [official documentation site](https://cloud.google.com/pubsub/docs).
|
||||
//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/pubsub1).
|
||||
//! # Features
|
||||
//!
|
||||
//! Handle the following *Resources* with ease from the central [hub](Pubsub) ...
|
||||
//! Handle the following *Resources* with ease from the central [hub](Pubsub) ...
|
||||
//!
|
||||
//! * projects
|
||||
//! * [*schemas commit*](api::ProjectSchemaCommitCall), [*schemas create*](api::ProjectSchemaCreateCall), [*schemas delete*](api::ProjectSchemaDeleteCall), [*schemas delete revision*](api::ProjectSchemaDeleteRevisionCall), [*schemas get*](api::ProjectSchemaGetCall), [*schemas get iam policy*](api::ProjectSchemaGetIamPolicyCall), [*schemas list*](api::ProjectSchemaListCall), [*schemas list revisions*](api::ProjectSchemaListRevisionCall), [*schemas rollback*](api::ProjectSchemaRollbackCall), [*schemas set iam policy*](api::ProjectSchemaSetIamPolicyCall), [*schemas test iam permissions*](api::ProjectSchemaTestIamPermissionCall), [*schemas validate*](api::ProjectSchemaValidateCall), [*schemas validate message*](api::ProjectSchemaValidateMessageCall), [*snapshots create*](api::ProjectSnapshotCreateCall), [*snapshots delete*](api::ProjectSnapshotDeleteCall), [*snapshots get*](api::ProjectSnapshotGetCall), [*snapshots get iam policy*](api::ProjectSnapshotGetIamPolicyCall), [*snapshots list*](api::ProjectSnapshotListCall), [*snapshots patch*](api::ProjectSnapshotPatchCall), [*snapshots set iam policy*](api::ProjectSnapshotSetIamPolicyCall), [*snapshots test iam permissions*](api::ProjectSnapshotTestIamPermissionCall), [*subscriptions acknowledge*](api::ProjectSubscriptionAcknowledgeCall), [*subscriptions create*](api::ProjectSubscriptionCreateCall), [*subscriptions delete*](api::ProjectSubscriptionDeleteCall), [*subscriptions detach*](api::ProjectSubscriptionDetachCall), [*subscriptions get*](api::ProjectSubscriptionGetCall), [*subscriptions get iam policy*](api::ProjectSubscriptionGetIamPolicyCall), [*subscriptions list*](api::ProjectSubscriptionListCall), [*subscriptions modify ack deadline*](api::ProjectSubscriptionModifyAckDeadlineCall), [*subscriptions modify push config*](api::ProjectSubscriptionModifyPushConfigCall), [*subscriptions patch*](api::ProjectSubscriptionPatchCall), [*subscriptions pull*](api::ProjectSubscriptionPullCall), [*subscriptions seek*](api::ProjectSubscriptionSeekCall), [*subscriptions set iam policy*](api::ProjectSubscriptionSetIamPolicyCall), [*subscriptions test iam permissions*](api::ProjectSubscriptionTestIamPermissionCall), [*topics create*](api::ProjectTopicCreateCall), [*topics delete*](api::ProjectTopicDeleteCall), [*topics get*](api::ProjectTopicGetCall), [*topics get iam policy*](api::ProjectTopicGetIamPolicyCall), [*topics list*](api::ProjectTopicListCall), [*topics patch*](api::ProjectTopicPatchCall), [*topics publish*](api::ProjectTopicPublishCall), [*topics set iam policy*](api::ProjectTopicSetIamPolicyCall), [*topics snapshots list*](api::ProjectTopicSnapshotListCall), [*topics subscriptions list*](api::ProjectTopicSubscriptionListCall) and [*topics test iam permissions*](api::ProjectTopicTestIamPermissionCall)
|
||||
@@ -57,8 +57,8 @@
|
||||
//! let r = hub.projects().topics_set_iam_policy(...).doit().await
|
||||
//! ```
|
||||
//!
|
||||
//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
|
||||
//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
|
||||
//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
|
||||
//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
|
||||
//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
|
||||
//! The `doit()` method performs the actual communication with the server and returns the respective result.
|
||||
//!
|
||||
@@ -82,23 +82,24 @@
|
||||
//! extern crate hyper_rustls;
|
||||
//! extern crate google_pubsub1 as pubsub1;
|
||||
//! use pubsub1::{Result, Error};
|
||||
//! use pubsub1::api::enums::*;
|
||||
//! # async fn dox() {
|
||||
//! use std::default::Default;
|
||||
//! use pubsub1::{Pubsub, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
//!
|
||||
//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
|
||||
//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
|
||||
//! // `client_secret`, among other things.
|
||||
//! let secret: oauth2::ApplicationSecret = Default::default();
|
||||
//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
|
||||
//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
|
||||
//! // unless you replace `None` with the desired Flow.
|
||||
//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
|
||||
//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
|
||||
//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
|
||||
//! // retrieve them from storage.
|
||||
//! let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
//! secret,
|
||||
//! oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
//! ).build().await.unwrap();
|
||||
//! let mut hub = Pubsub::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
//! let mut hub = Pubsub::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
//! // You can configure optional parameters by calling the respective setters at will, and
|
||||
//! // execute the final call using `doit()`.
|
||||
//! // Values shown here are possibly random and not representative !
|
||||
@@ -128,10 +129,10 @@
|
||||
//! ## Handling Errors
|
||||
//!
|
||||
//! All errors produced by the system are provided either as [Result](client::Result) enumeration as return value of
|
||||
//! the doit() methods, or handed as possibly intermediate results to either the
|
||||
//! the doit() methods, or handed as possibly intermediate results to either the
|
||||
//! [Hub Delegate](client::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
|
||||
//!
|
||||
//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
|
||||
//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
|
||||
//! makes the system potentially resilient to all kinds of errors.
|
||||
//!
|
||||
//! ## Uploads and Downloads
|
||||
@@ -141,25 +142,25 @@
|
||||
//! You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making
|
||||
//! this call: `.param("alt", "media")`.
|
||||
//!
|
||||
//! Methods supporting uploads can do so using up to 2 different protocols:
|
||||
//! *simple* and *resumable*. The distinctiveness of each is represented by customized
|
||||
//! Methods supporting uploads can do so using up to 2 different protocols:
|
||||
//! *simple* and *resumable*. The distinctiveness of each is represented by customized
|
||||
//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
|
||||
//!
|
||||
//! ## Customization and Callbacks
|
||||
//!
|
||||
//! You may alter the way an `doit()` method is called by providing a [delegate](client::Delegate) to the
|
||||
//! [Method Builder](client::CallBuilder) before making the final `doit()` call.
|
||||
//! Respective methods will be called to provide progress information, as well as determine whether the system should
|
||||
//! You may alter the way an `doit()` method is called by providing a [delegate](client::Delegate) to the
|
||||
//! [Method Builder](client::CallBuilder) before making the final `doit()` call.
|
||||
//! Respective methods will be called to provide progress information, as well as determine whether the system should
|
||||
//! retry on failure.
|
||||
//!
|
||||
//! The [delegate trait](client::Delegate) is default-implemented, allowing you to customize it with minimal effort.
|
||||
//!
|
||||
//! ## Optional Parts in Server-Requests
|
||||
//!
|
||||
//! All structures provided by this library are made to be [encodable](client::RequestValue) and
|
||||
//! [decodable](client::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
|
||||
//! All structures provided by this library are made to be [encodable](client::RequestValue) and
|
||||
//! [decodable](client::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
|
||||
//! are valid.
|
||||
//! Most optionals are are considered [Parts](client::Part) which are identifiable by name, which will be sent to
|
||||
//! Most optionals are are considered [Parts](client::Part) which are identifiable by name, which will be sent to
|
||||
//! the server to indicate either the set parts of the request or the desired parts in the response.
|
||||
//!
|
||||
//! ## Builder Arguments
|
||||
|
||||
Reference in New Issue
Block a user