Skip to content

Commit

Permalink
Merge pull request softprops#149 from Snnappie/master
Browse files Browse the repository at this point in the history
Update to rusoto 0.46
  • Loading branch information
softprops authored Jan 9, 2021
2 parents fbc946c + 73e41b1 commit dc8ba09
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 22 deletions.
36 changes: 27 additions & 9 deletions dynomite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,47 @@ maintenance = { status = "actively-developed" }
[dependencies]
async-trait = "0.1"
again = "0.1"
bytes = "0.5"
bytes = "1"
dynomite-derive = { version = "0.10.0", path = "../dynomite-derive", optional = true }
futures = "0.3"
log = "0.4"
rusoto_core_default = { package = "rusoto_core", version = "0.45", optional = true }
rusoto_core_rustls = { package = "rusoto_core", version = "0.45", default_features = false, features=["rustls"], optional = true }
rusoto_dynamodb_default = { package = "rusoto_dynamodb", version = "0.45", optional = true }
rusoto_dynamodb_rustls = { package = "rusoto_dynamodb", version = "0.45", default_features = false, features=["rustls"], optional = true }
# Disable default features since the `rustls` variant requires it. We re-enable `default` in our
# `default` build configuration - see the [features] below.
rusoto_core = { version = "0.46", optional = true, default_features = false }
rusoto_dynamodb = { version = "0.46", optional = true, default_features = false }
uuid = { version = "0.8", features = ["v4"], optional = true }
chrono = { version = "0.4", optional = true }

[dev-dependencies]
env_logger = "0.7"
env_logger = "0.8"
maplit = "1.0"
serde = "1.0"
serde_json = "1.0"
tokio = { version = "0.2", features = ["macros"] }
tokio = { version = "1", features = ["macros"] }
lambda_http = { git = "https://github.com/awslabs/aws-lambda-rust-runtime/", branch = "master"}
trybuild = "1.0"
rustversion = "1.0"
dynomite-derive = { version = "0.10.0", path = "../dynomite-derive" } # required by trybuild

[features]
default = ["uuid", "chrono", "derive", "rusoto_core_default", "rusoto_dynamodb_default"]
rustls = ["uuid", "chrono", "derive", "rusoto_core_rustls", "rusoto_dynamodb_rustls"]
default = [
"uuid",
"chrono",
"derive",
"rusoto_core",
"rusoto_dynamodb",
# Enable the `default` features of these crates.
"rusoto_core/default",
"rusoto_dynamodb/default"
]

rustls = [
"uuid",
"chrono",
"derive",
"rusoto_core",
"rusoto_dynamodb",
"rusoto_core/rustls",
"rusoto_dynamodb/rustls"
]
derive = ["dynomite-derive"]
5 changes: 1 addition & 4 deletions dynomite/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ use crate::dynamodb::{
ListTablesInput, QueryError, QueryInput, ScanError, ScanInput,
};
use futures::{stream, Stream, TryStreamExt};
#[cfg(feature = "default")]
use rusoto_core_default::RusotoError;
#[cfg(feature = "rustls")]
use rusoto_core_rustls::RusotoError;
use rusoto_core::RusotoError;
use std::{collections::HashMap, pin::Pin};

type DynomiteStream<I, E> = Pin<Box<dyn Stream<Item = Result<I, RusotoError<E>>> + Send>>;
Expand Down
11 changes: 6 additions & 5 deletions dynomite/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,18 +340,19 @@
#![deny(missing_docs)]
// reexported
// note: this is used inside the attr_map! macro
#[cfg(feature = "default")]
pub use rusoto_dynamodb_default as dynamodb;

#[cfg(feature = "rustls")]
pub use rusoto_dynamodb_rustls as dynamodb;
// #[cfg(feature = "default")]
// pub use rusoto_dynamodb_default as dynamodb;
//
// #[cfg(feature = "rustls")]
// pub use rusoto_dynamodb_rustls as dynamodb;

use bytes::Bytes;
#[cfg(feature = "chrono")]
use chrono::{
offset::{FixedOffset, Local},
DateTime, Utc,
};
pub use rusoto_dynamodb as dynamodb;

// we re-export this because we
// refer to it with in derive macros
Expand Down
86 changes: 82 additions & 4 deletions dynomite/src/retry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
use crate::dynamodb::*;
use again::{Condition, RetryPolicy};
use log::debug;
#[cfg(feature = "default")]
use rusoto_core_default::RusotoError;
#[cfg(feature = "rustls")]
use rusoto_core_rustls::RusotoError;
use rusoto_core::RusotoError;
use std::{sync::Arc, time::Duration};

/// Pre-configured retry policies for fallible operations
Expand Down Expand Up @@ -304,6 +301,13 @@ where
.await
}

async fn describe_export(
&self,
input: DescribeExportInput,
) -> Result<DescribeExportOutput, RusotoError<DescribeExportError>> {
self.inner.client.describe_export(input).await
}

async fn describe_continuous_backups(
&self,
input: DescribeContinuousBackupsInput,
Expand Down Expand Up @@ -460,6 +464,13 @@ where
.await
}

async fn list_exports(
&self,
input: ListExportsInput,
) -> Result<ListExportsOutput, RusotoError<ListExportsError>> {
self.inner.client.list_exports(input).await
}

async fn list_contributor_insights(
&self,
input: ListContributorInsightsInput,
Expand Down Expand Up @@ -802,6 +813,73 @@ where
)
.await
}

async fn batch_execute_statement(
&self,
input: BatchExecuteStatementInput,
) -> Result<BatchExecuteStatementOutput, RusotoError<BatchExecuteStatementError>> {
self.inner.client.batch_execute_statement(input).await
}

async fn execute_statement(
&self,
input: ExecuteStatementInput,
) -> Result<ExecuteStatementOutput, RusotoError<ExecuteStatementError>> {
self.inner.client.execute_statement(input).await
}

async fn execute_transaction(
&self,
input: ExecuteTransactionInput,
) -> Result<ExecuteTransactionOutput, RusotoError<ExecuteTransactionError>> {
self.inner.client.execute_transaction(input).await
}

async fn describe_kinesis_streaming_destination(
&self,
input: DescribeKinesisStreamingDestinationInput,
) -> Result<
DescribeKinesisStreamingDestinationOutput,
RusotoError<DescribeKinesisStreamingDestinationError>,
> {
self.inner
.client
.describe_kinesis_streaming_destination(input)
.await
}

async fn enable_kinesis_streaming_destination(
&self,
input: KinesisStreamingDestinationInput,
) -> Result<
KinesisStreamingDestinationOutput,
RusotoError<EnableKinesisStreamingDestinationError>,
> {
self.inner
.client
.enable_kinesis_streaming_destination(input)
.await
}

async fn disable_kinesis_streaming_destination(
&self,
input: KinesisStreamingDestinationInput,
) -> Result<
KinesisStreamingDestinationOutput,
RusotoError<DisableKinesisStreamingDestinationError>,
> {
self.inner
.client
.disable_kinesis_streaming_destination(input)
.await
}

async fn export_table_to_point_in_time(
&self,
input: ExportTableToPointInTimeInput,
) -> Result<ExportTableToPointInTimeOutput, RusotoError<ExportTableToPointInTimeError>> {
self.inner.client.export_table_to_point_in_time(input).await
}
}

/// retry impl for Service error types
Expand Down

0 comments on commit dc8ba09

Please sign in to comment.