Skip to content

Commit ca3b4a5

Browse files
ysaito1001Zelda Hessler
authored andcommitted
[smithy-rs] Allow "Update GitHub Pages" to opt-in to cargo sparse registry (#2610)
## Motivation and Context Addresses a CI failure within `Update GitHub Pages` due to the use of the cargo sparse registry ([example](https://github.com/awslabs/smithy-rs/actions/runs/4746548497/jobs/8430328515)). ## Description The PR allows the action to configure whether the cargo sparse registry is used via the environment variable [CARGO_UNSTABLE_SPARSE_REGISTRY](https://blog.rust-lang.org/2022/06/22/sparse-registry-testing.html#overview): <img width="800" alt="Screenshot 2023-04-20 at 11 55 06 AM" src="https://user-images.githubusercontent.com/15333866/233435686-d24ceb2f-facf-45c9-b6cb-490b8ea2b085.png"> ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: Yuki Saito <awsaito@amazon.com> Co-authored-by: Zelda Hessler <zhessler@amazon.com>
1 parent f392e8c commit ca3b4a5

File tree

219 files changed

+9289
-13208
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+9289
-13208
lines changed

sdk/resourcegroups/src/client.rs

Lines changed: 117 additions & 151 deletions
Large diffs are not rendered by default.
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2-
impl super::Client {
2+
impl super::Client {
33
/// Constructs a fluent builder for the [`CreateGroup`](crate::operation::create_group::builders::CreateGroupFluentBuilder) operation.
4-
///
5-
/// - The fluent builder is configurable:
4+
///
5+
/// - The fluent builder is configurable:
66
/// - [`name(impl Into<String>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::name) / [`set_name(Option<String>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::set_name): <p>The name of the group, which is the identifier of the group in other operations. You can't change the name of a resource group after you create it. A resource group name can consist of letters, numbers, hyphens, periods, and underscores. The name cannot start with <code>AWS</code> or <code>aws</code>; these are reserved. A resource group name must be unique within each Amazon Web Services Region in your Amazon Web Services account.</p>
77
/// - [`description(impl Into<String>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::description) / [`set_description(Option<String>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::set_description): <p>The description of the resource group. Descriptions can consist of letters, numbers, hyphens, underscores, periods, and spaces.</p>
88
/// - [`resource_query(ResourceQuery)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::resource_query) / [`set_resource_query(Option<ResourceQuery>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::set_resource_query): <p>The resource query that determines which Amazon Web Services resources are members of this group. For more information about resource queries, see <a href="https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted-query.html#gettingstarted-query-cli-tag">Create a tag-based group in Resource Groups</a>. </p> <note> <p>A resource group can contain either a <code>ResourceQuery</code> or a <code>Configuration</code>, but not both.</p> </note>
99
/// - [`tags(HashMap<String, String>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::tags) / [`set_tags(Option<HashMap<String, String>>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::set_tags): <p>The tags to add to the group. A tag is key-value pair string.</p>
1010
/// - [`configuration(Vec<GroupConfigurationItem>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::configuration) / [`set_configuration(Option<Vec<GroupConfigurationItem>>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::set_configuration): <p>A configuration associates the resource group with an Amazon Web Services service and specifies how the service can interact with the resources in the group. A configuration is an array of <code>GroupConfigurationItem</code> elements. For details about the syntax of service configurations, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for Resource Groups</a>.</p> <note> <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p> </note>
11-
/// - On success, responds with [`CreateGroupOutput`](crate::operation::create_group::CreateGroupOutput) with field(s):
11+
/// - On success, responds with [`CreateGroupOutput`](crate::operation::create_group::CreateGroupOutput) with field(s):
1212
/// - [`group(Option<Group>)`](crate::operation::create_group::CreateGroupOutput::group): <p>The description of the resource group.</p>
1313
/// - [`resource_query(Option<ResourceQuery>)`](crate::operation::create_group::CreateGroupOutput::resource_query): <p>The resource query associated with the group. For more information about resource queries, see <a href="https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted-query.html#gettingstarted-query-cli-tag">Create a tag-based group in Resource Groups</a>. </p>
1414
/// - [`tags(Option<HashMap<String, String>>)`](crate::operation::create_group::CreateGroupOutput::tags): <p>The tags associated with the group.</p>
1515
/// - [`group_configuration(Option<GroupConfiguration>)`](crate::operation::create_group::CreateGroupOutput::group_configuration): <p>The service configuration associated with the resource group. For details about the syntax of a service configuration, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for Resource Groups</a>.</p>
16-
/// - On failure, responds with [`SdkError<CreateGroupError>`](crate::operation::create_group::CreateGroupError)
17-
pub fn create_group(
18-
&self,
19-
) -> crate::operation::create_group::builders::CreateGroupFluentBuilder {
20-
crate::operation::create_group::builders::CreateGroupFluentBuilder::new(self.handle.clone())
21-
}
16+
/// - On failure, responds with [`SdkError<CreateGroupError>`](crate::operation::create_group::CreateGroupError)
17+
pub fn create_group(&self) -> crate::operation::create_group::builders::CreateGroupFluentBuilder {
18+
crate::operation::create_group::builders::CreateGroupFluentBuilder::new(self.handle.clone())
19+
}
2220
}
21+
Lines changed: 71 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,82 @@
11
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2-
use crate::client::Handle;
32
pub use aws_smithy_http::operation::Operation;
4-
pub use aws_smithy_http::operation::Request;
5-
pub use aws_smithy_http::operation::Response;
6-
pub use aws_smithy_http::retry::ClassifyRetry;
7-
pub use aws_smithy_types::retry::RetryKind;
3+
pub use aws_smithy_http::operation::Request;
4+
pub use aws_smithy_http::operation::Response;
5+
pub use aws_smithy_http::retry::ClassifyRetry;
6+
pub use aws_smithy_types::retry::RetryKind;
7+
use crate::client::Handle;
8+
9+
use aws_smithy_http::body::SdkBody;
10+
use aws_smithy_http::result::SdkError;
811

9-
use aws_smithy_http::body::SdkBody;
10-
use aws_smithy_http::result::SdkError;
12+
use std::convert::Infallible;
13+
use std::sync::Arc;
1114

12-
use std::convert::Infallible;
13-
use std::sync::Arc;
15+
/// A wrapper type for [`Operation`](aws_smithy_http::operation::Operation)s that allows for
16+
/// customization of the operation before it is sent. A `CustomizableOperation` may be sent
17+
/// by calling its [`.send()`][crate::client::customize::CustomizableOperation::send] method.
18+
#[derive(Debug)]
19+
pub struct CustomizableOperation<O, Retry> {
20+
pub(crate) handle: Arc<Handle>,
21+
pub(crate) operation: Operation<O, Retry>,
22+
}
1423

15-
/// A wrapper type for [`Operation`](aws_smithy_http::operation::Operation)s that allows for
16-
/// customization of the operation before it is sent. A `CustomizableOperation` may be sent
17-
/// by calling its [`.send()`][crate::client::customize::CustomizableOperation::send] method.
18-
#[derive(Debug)]
19-
pub struct CustomizableOperation<O, Retry> {
20-
pub(crate) handle: Arc<Handle>,
21-
pub(crate) operation: Operation<O, Retry>,
22-
}
24+
impl<O, Retry> CustomizableOperation<O, Retry>
25+
where
26+
27+
{
28+
/// Allows for customizing the operation's request
29+
pub fn map_request<E>(
30+
mut self,
31+
f: impl FnOnce(http::Request<SdkBody>) -> Result<http::Request<SdkBody>, E>,
32+
) -> Result<Self, E> {
33+
let (request, response) = self.operation.into_request_response();
34+
let request = request.augment(|req, _props| f(req))?;
35+
self.operation = Operation::from_parts(request, response);
36+
Ok(self)
37+
}
2338

24-
impl<O, Retry> CustomizableOperation<O, Retry> {
25-
/// Allows for customizing the operation's request
26-
pub fn map_request<E>(
27-
mut self,
28-
f: impl FnOnce(http::Request<SdkBody>) -> Result<http::Request<SdkBody>, E>,
29-
) -> Result<Self, E> {
30-
let (request, response) = self.operation.into_request_response();
31-
let request = request.augment(|req, _props| f(req))?;
32-
self.operation = Operation::from_parts(request, response);
33-
Ok(self)
34-
}
39+
/// Convenience for `map_request` where infallible direct mutation of request is acceptable
40+
pub fn mutate_request(self, f: impl FnOnce(&mut http::Request<SdkBody>)) -> Self {
41+
self.map_request(|mut req| {
42+
f(&mut req);
43+
Result::<_, Infallible>::Ok(req)
44+
})
45+
.expect("infallible")
46+
}
3547

36-
/// Convenience for `map_request` where infallible direct mutation of request is acceptable
37-
pub fn mutate_request(self, f: impl FnOnce(&mut http::Request<SdkBody>)) -> Self {
38-
self.map_request(|mut req| {
39-
f(&mut req);
40-
Result::<_, Infallible>::Ok(req)
41-
})
42-
.expect("infallible")
43-
}
48+
/// Allows for customizing the entire operation
49+
pub fn map_operation<E>(
50+
mut self,
51+
f: impl FnOnce(Operation<O, Retry>) -> Result<Operation<O, Retry>, E>,
52+
) -> Result<Self, E> {
53+
self.operation = f(self.operation)?;
54+
Ok(self)
55+
}
4456

45-
/// Allows for customizing the entire operation
46-
pub fn map_operation<E>(
47-
mut self,
48-
f: impl FnOnce(Operation<O, Retry>) -> Result<Operation<O, Retry>, E>,
49-
) -> Result<Self, E> {
50-
self.operation = f(self.operation)?;
51-
Ok(self)
52-
}
57+
/// Direct access to read the HTTP request
58+
pub fn request(&self) -> &http::Request<SdkBody> {
59+
self.operation.request()
60+
}
5361

54-
/// Direct access to read the HTTP request
55-
pub fn request(&self) -> &http::Request<SdkBody> {
56-
self.operation.request()
57-
}
62+
/// Direct access to mutate the HTTP request
63+
pub fn request_mut(&mut self) -> &mut http::Request<SdkBody> {
64+
self.operation.request_mut()
65+
}
66+
}
5867

59-
/// Direct access to mutate the HTTP request
60-
pub fn request_mut(&mut self) -> &mut http::Request<SdkBody> {
61-
self.operation.request_mut()
62-
}
63-
}
68+
impl<O, Retry> CustomizableOperation<O, Retry>
69+
where
70+
71+
{
72+
/// Sends this operation's request
73+
pub async fn send<T, E>(self) -> Result<T, SdkError<E>>
74+
where
75+
E: std::error::Error + Send + Sync + 'static,
76+
O: aws_smithy_http::response::ParseHttpResponse<Output = Result<T, E>> + Send + Sync + Clone + 'static,
77+
Retry: aws_smithy_http::retry::ClassifyRetry<aws_smithy_http::result::SdkSuccess<T>, aws_smithy_http::result::SdkError<E>> + Send + Sync + Clone,
78+
{
79+
self.handle.client.call(self.operation).await
80+
}
81+
}
6482

65-
impl<O, Retry> CustomizableOperation<O, Retry> {
66-
/// Sends this operation's request
67-
pub async fn send<T, E>(self) -> Result<T, SdkError<E>>
68-
where
69-
E: std::error::Error + Send + Sync + 'static,
70-
O: aws_smithy_http::response::ParseHttpResponse<Output = Result<T, E>>
71-
+ Send
72-
+ Sync
73-
+ Clone
74-
+ 'static,
75-
Retry: aws_smithy_http::retry::ClassifyRetry<
76-
aws_smithy_http::result::SdkSuccess<T>,
77-
aws_smithy_http::result::SdkError<E>,
78-
> + Send
79-
+ Sync
80-
+ Clone,
81-
{
82-
self.handle.client.call(self.operation).await
83-
}
84-
}
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2-
impl super::Client {
2+
impl super::Client {
33
/// Constructs a fluent builder for the [`DeleteGroup`](crate::operation::delete_group::builders::DeleteGroupFluentBuilder) operation.
4-
///
5-
/// - The fluent builder is configurable:
4+
///
5+
/// - The fluent builder is configurable:
66
/// - [`group_name(impl Into<String>)`](crate::operation::delete_group::builders::DeleteGroupFluentBuilder::group_name) / [`set_group_name(Option<String>)`](crate::operation::delete_group::builders::DeleteGroupFluentBuilder::set_group_name): <p>Deprecated - don't use this parameter. Use <code>Group</code> instead.</p>
77
/// - [`group(impl Into<String>)`](crate::operation::delete_group::builders::DeleteGroupFluentBuilder::group) / [`set_group(Option<String>)`](crate::operation::delete_group::builders::DeleteGroupFluentBuilder::set_group): <p>The name or the ARN of the resource group to delete.</p>
8-
/// - On success, responds with [`DeleteGroupOutput`](crate::operation::delete_group::DeleteGroupOutput) with field(s):
8+
/// - On success, responds with [`DeleteGroupOutput`](crate::operation::delete_group::DeleteGroupOutput) with field(s):
99
/// - [`group(Option<Group>)`](crate::operation::delete_group::DeleteGroupOutput::group): <p>A full description of the deleted resource group.</p>
10-
/// - On failure, responds with [`SdkError<DeleteGroupError>`](crate::operation::delete_group::DeleteGroupError)
11-
pub fn delete_group(
12-
&self,
13-
) -> crate::operation::delete_group::builders::DeleteGroupFluentBuilder {
14-
crate::operation::delete_group::builders::DeleteGroupFluentBuilder::new(self.handle.clone())
15-
}
10+
/// - On failure, responds with [`SdkError<DeleteGroupError>`](crate::operation::delete_group::DeleteGroupError)
11+
pub fn delete_group(&self) -> crate::operation::delete_group::builders::DeleteGroupFluentBuilder {
12+
crate::operation::delete_group::builders::DeleteGroupFluentBuilder::new(self.handle.clone())
13+
}
1614
}
15+
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2-
impl super::Client {
2+
impl super::Client {
33
/// Constructs a fluent builder for the [`GetAccountSettings`](crate::operation::get_account_settings::builders::GetAccountSettingsFluentBuilder) operation.
4-
///
5-
/// - The fluent builder takes no input, just [`send`](crate::operation::get_account_settings::builders::GetAccountSettingsFluentBuilder::send) it.
6-
/// - On success, responds with [`GetAccountSettingsOutput`](crate::operation::get_account_settings::GetAccountSettingsOutput) with field(s):
4+
///
5+
/// - The fluent builder takes no input, just [`send`](crate::operation::get_account_settings::builders::GetAccountSettingsFluentBuilder::send) it.
6+
/// - On success, responds with [`GetAccountSettingsOutput`](crate::operation::get_account_settings::GetAccountSettingsOutput) with field(s):
77
/// - [`account_settings(Option<AccountSettings>)`](crate::operation::get_account_settings::GetAccountSettingsOutput::account_settings): <p>The current settings for the optional features in Resource Groups.</p>
8-
/// - On failure, responds with [`SdkError<GetAccountSettingsError>`](crate::operation::get_account_settings::GetAccountSettingsError)
9-
pub fn get_account_settings(
10-
&self,
11-
) -> crate::operation::get_account_settings::builders::GetAccountSettingsFluentBuilder {
12-
crate::operation::get_account_settings::builders::GetAccountSettingsFluentBuilder::new(
13-
self.handle.clone(),
14-
)
15-
}
8+
/// - On failure, responds with [`SdkError<GetAccountSettingsError>`](crate::operation::get_account_settings::GetAccountSettingsError)
9+
pub fn get_account_settings(&self) -> crate::operation::get_account_settings::builders::GetAccountSettingsFluentBuilder {
10+
crate::operation::get_account_settings::builders::GetAccountSettingsFluentBuilder::new(self.handle.clone())
11+
}
1612
}
13+
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2-
impl super::Client {
2+
impl super::Client {
33
/// Constructs a fluent builder for the [`GetGroup`](crate::operation::get_group::builders::GetGroupFluentBuilder) operation.
4-
///
5-
/// - The fluent builder is configurable:
4+
///
5+
/// - The fluent builder is configurable:
66
/// - [`group_name(impl Into<String>)`](crate::operation::get_group::builders::GetGroupFluentBuilder::group_name) / [`set_group_name(Option<String>)`](crate::operation::get_group::builders::GetGroupFluentBuilder::set_group_name): <p>Deprecated - don't use this parameter. Use <code>Group</code> instead.</p>
77
/// - [`group(impl Into<String>)`](crate::operation::get_group::builders::GetGroupFluentBuilder::group) / [`set_group(Option<String>)`](crate::operation::get_group::builders::GetGroupFluentBuilder::set_group): <p>The name or the ARN of the resource group to retrieve.</p>
8-
/// - On success, responds with [`GetGroupOutput`](crate::operation::get_group::GetGroupOutput) with field(s):
8+
/// - On success, responds with [`GetGroupOutput`](crate::operation::get_group::GetGroupOutput) with field(s):
99
/// - [`group(Option<Group>)`](crate::operation::get_group::GetGroupOutput::group): <p>A structure that contains the metadata details for the specified resource group. Use <code>GetGroupQuery</code> and <code>GetGroupConfiguration</code> to get those additional details of the resource group.</p>
10-
/// - On failure, responds with [`SdkError<GetGroupError>`](crate::operation::get_group::GetGroupError)
10+
/// - On failure, responds with [`SdkError<GetGroupError>`](crate::operation::get_group::GetGroupError)
1111
pub fn get_group(&self) -> crate::operation::get_group::builders::GetGroupFluentBuilder {
12-
crate::operation::get_group::builders::GetGroupFluentBuilder::new(self.handle.clone())
13-
}
12+
crate::operation::get_group::builders::GetGroupFluentBuilder::new(self.handle.clone())
13+
}
1414
}
15+

0 commit comments

Comments
 (0)