Skip to content

Commit

Permalink
Adds UpdateLibraryItemMetadata api to change status of app for admin …
Browse files Browse the repository at this point in the history
…verification feature and returns isVerified field in any api returning the app or library item.
  • Loading branch information
aws-sdk-cpp-automation committed Sep 6, 2024
1 parent 0c516dd commit af8d1fb
Show file tree
Hide file tree
Showing 18 changed files with 415 additions and 20 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.399
1.11.400
50 changes: 41 additions & 9 deletions generated/src/aws-cpp-sdk-qapps/include/aws/qapps/QAppsClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@ namespace QApps
/**
* <p>The Amazon Q Apps feature capability within Amazon Q Business allows web
* experience users to create lightweight, purpose-built AI apps to fulfill
* specific tasks from within their web experience. For example, users can create
* an Q Appthat exclusively generates marketing-related content to improve your
* marketing team's productivity or a Q App for marketing content-generation like
* writing customer emails and creating promotional content using a certain style
* of voice, tone, and branding. For more information, see <a
* href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/purpose-built-qapps.html">Amazon
* Q App</a> in the <i>Amazon Q Business User Guide</i>. </p>
* specific tasks from within their web experience. For example, users can create a
* Q App that exclusively generates marketing-related content to improve your
* marketing team's productivity or a Q App for writing customer emails and
* creating promotional content using a certain style of voice, tone, and branding.
* For more information on the capabilities, see <a
* href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/deploy-experience-iam-role.html#q-apps-actions">Amazon
* Q Apps capabilities</a> in the <i>Amazon Q Business User Guide</i>. </p> <p>For
* an overview of the Amazon Q App APIs, see <a
* href="https://docs.aws.amazon.com/amazonq/latest/api-reference/API_Operations_QApps.html">Overview
* of Amazon Q Apps API operations</a>.</p> <p>For information about the IAM access
* control permissions you need to use the Amazon Q Apps API, see <a
* href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/deploy-experience-iam-role.html">
* IAM role for the Amazon Q Business web experience including Amazon Q Apps</a> in
* the <i>Amazon Q Business User Guide</i>.</p>
*/
class AWS_QAPPS_API QAppsClient : public Aws::Client::AWSJsonClient, public Aws::Client::ClientWithAsyncTemplateMethods<QAppsClient>
{
Expand Down Expand Up @@ -622,8 +629,7 @@ namespace QApps
}

/**
* <p>Updates the metadata and status of a library item for an Amazon Q
* App.</p><p><h3>See Also:</h3> <a
* <p>Updates the library item for an Amazon Q App.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/qapps-2023-11-27/UpdateLibraryItem">AWS
* API Reference</a></p>
*/
Expand All @@ -647,6 +653,32 @@ namespace QApps
return SubmitAsync(&QAppsClient::UpdateLibraryItem, request, handler, context);
}

/**
* <p>Updates the verification status of a library item for an Amazon Q
* App.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/qapps-2023-11-27/UpdateLibraryItemMetadata">AWS
* API Reference</a></p>
*/
virtual Model::UpdateLibraryItemMetadataOutcome UpdateLibraryItemMetadata(const Model::UpdateLibraryItemMetadataRequest& request) const;

/**
* A Callable wrapper for UpdateLibraryItemMetadata that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template<typename UpdateLibraryItemMetadataRequestT = Model::UpdateLibraryItemMetadataRequest>
Model::UpdateLibraryItemMetadataOutcomeCallable UpdateLibraryItemMetadataCallable(const UpdateLibraryItemMetadataRequestT& request) const
{
return SubmitCallable(&QAppsClient::UpdateLibraryItemMetadata, request);
}

/**
* An Async wrapper for UpdateLibraryItemMetadata that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template<typename UpdateLibraryItemMetadataRequestT = Model::UpdateLibraryItemMetadataRequest>
void UpdateLibraryItemMetadataAsync(const UpdateLibraryItemMetadataRequestT& request, const UpdateLibraryItemMetadataResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const
{
return SubmitAsync(&QAppsClient::UpdateLibraryItemMetadata, request, handler, context);
}

/**
* <p>Updates an existing Amazon Q App, allowing modifications to its title,
* description, and definition.</p><p><h3>See Also:</h3> <a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ namespace Aws
class TagResourceRequest;
class UntagResourceRequest;
class UpdateLibraryItemRequest;
class UpdateLibraryItemMetadataRequest;
class UpdateQAppRequest;
class UpdateQAppSessionRequest;
/* End of service model forward declarations required in QAppsClient header */
Expand All @@ -122,6 +123,7 @@ namespace Aws
typedef Aws::Utils::Outcome<TagResourceResult, QAppsError> TagResourceOutcome;
typedef Aws::Utils::Outcome<UntagResourceResult, QAppsError> UntagResourceOutcome;
typedef Aws::Utils::Outcome<UpdateLibraryItemResult, QAppsError> UpdateLibraryItemOutcome;
typedef Aws::Utils::Outcome<Aws::NoResult, QAppsError> UpdateLibraryItemMetadataOutcome;
typedef Aws::Utils::Outcome<UpdateQAppResult, QAppsError> UpdateQAppOutcome;
typedef Aws::Utils::Outcome<UpdateQAppSessionResult, QAppsError> UpdateQAppSessionOutcome;
/* End of service model Outcome class definitions */
Expand All @@ -148,6 +150,7 @@ namespace Aws
typedef std::future<TagResourceOutcome> TagResourceOutcomeCallable;
typedef std::future<UntagResourceOutcome> UntagResourceOutcomeCallable;
typedef std::future<UpdateLibraryItemOutcome> UpdateLibraryItemOutcomeCallable;
typedef std::future<UpdateLibraryItemMetadataOutcome> UpdateLibraryItemMetadataOutcomeCallable;
typedef std::future<UpdateQAppOutcome> UpdateQAppOutcomeCallable;
typedef std::future<UpdateQAppSessionOutcome> UpdateQAppSessionOutcomeCallable;
/* End of service model Outcome callable definitions */
Expand Down Expand Up @@ -177,6 +180,7 @@ namespace Aws
typedef std::function<void(const QAppsClient*, const Model::TagResourceRequest&, const Model::TagResourceOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > TagResourceResponseReceivedHandler;
typedef std::function<void(const QAppsClient*, const Model::UntagResourceRequest&, const Model::UntagResourceOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UntagResourceResponseReceivedHandler;
typedef std::function<void(const QAppsClient*, const Model::UpdateLibraryItemRequest&, const Model::UpdateLibraryItemOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateLibraryItemResponseReceivedHandler;
typedef std::function<void(const QAppsClient*, const Model::UpdateLibraryItemMetadataRequest&, const Model::UpdateLibraryItemMetadataOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateLibraryItemMetadataResponseReceivedHandler;
typedef std::function<void(const QAppsClient*, const Model::UpdateQAppRequest&, const Model::UpdateQAppOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateQAppResponseReceivedHandler;
typedef std::function<void(const QAppsClient*, const Model::UpdateQAppSessionRequest&, const Model::UpdateQAppSessionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateQAppSessionResponseReceivedHandler;
/* End of service model async handlers definitions */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ namespace Model
inline CreateLibraryItemResult& WithRatingCount(int value) { SetRatingCount(value); return *this;}
///@}

///@{
/**
* <p>Indicates whether the library item has been verified.</p>
*/
inline bool GetIsVerified() const{ return m_isVerified; }
inline void SetIsVerified(bool value) { m_isVerified = value; }
inline CreateLibraryItemResult& WithIsVerified(bool value) { SetIsVerified(value); return *this;}
///@}

///@{

inline const Aws::String& GetRequestId() const{ return m_requestId; }
Expand All @@ -142,6 +151,8 @@ namespace Model

int m_ratingCount;

bool m_isVerified;

Aws::String m_requestId;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@ namespace Model
inline GetLibraryItemResult& WithUserCount(int value) { SetUserCount(value); return *this;}
///@}

///@{
/**
* <p>Indicates whether the library item has been verified.</p>
*/
inline bool GetIsVerified() const{ return m_isVerified; }
inline void SetIsVerified(bool value) { m_isVerified = value; }
inline GetLibraryItemResult& WithIsVerified(bool value) { SetIsVerified(value); return *this;}
///@}

///@{

inline const Aws::String& GetRequestId() const{ return m_requestId; }
Expand Down Expand Up @@ -207,6 +216,8 @@ namespace Model

int m_userCount;

bool m_isVerified;

Aws::String m_requestId;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,16 @@ namespace Model
inline void SetUserCount(int value) { m_userCountHasBeenSet = true; m_userCount = value; }
inline LibraryItemMember& WithUserCount(int value) { SetUserCount(value); return *this;}
///@}

///@{
/**
* <p>Indicates whether the library item has been verified.</p>
*/
inline bool GetIsVerified() const{ return m_isVerified; }
inline bool IsVerifiedHasBeenSet() const { return m_isVerifiedHasBeenSet; }
inline void SetIsVerified(bool value) { m_isVerifiedHasBeenSet = true; m_isVerified = value; }
inline LibraryItemMember& WithIsVerified(bool value) { SetIsVerified(value); return *this;}
///@}
private:

Aws::String m_libraryItemId;
Expand Down Expand Up @@ -226,6 +236,9 @@ namespace Model

int m_userCount;
bool m_userCountHasBeenSet = false;

bool m_isVerified;
bool m_isVerifiedHasBeenSet = false;
};

} // namespace Model
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once
#include <aws/qapps/QApps_EXPORTS.h>
#include <aws/qapps/QAppsRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace QApps
{
namespace Model
{

/**
*/
class UpdateLibraryItemMetadataRequest : public QAppsRequest
{
public:
AWS_QAPPS_API UpdateLibraryItemMetadataRequest();

// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "UpdateLibraryItemMetadata"; }

AWS_QAPPS_API Aws::String SerializePayload() const override;

AWS_QAPPS_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;


///@{
/**
* <p>The unique identifier of the Amazon Q Business application environment
* instance.</p>
*/
inline const Aws::String& GetInstanceId() const{ return m_instanceId; }
inline bool InstanceIdHasBeenSet() const { return m_instanceIdHasBeenSet; }
inline void SetInstanceId(const Aws::String& value) { m_instanceIdHasBeenSet = true; m_instanceId = value; }
inline void SetInstanceId(Aws::String&& value) { m_instanceIdHasBeenSet = true; m_instanceId = std::move(value); }
inline void SetInstanceId(const char* value) { m_instanceIdHasBeenSet = true; m_instanceId.assign(value); }
inline UpdateLibraryItemMetadataRequest& WithInstanceId(const Aws::String& value) { SetInstanceId(value); return *this;}
inline UpdateLibraryItemMetadataRequest& WithInstanceId(Aws::String&& value) { SetInstanceId(std::move(value)); return *this;}
inline UpdateLibraryItemMetadataRequest& WithInstanceId(const char* value) { SetInstanceId(value); return *this;}
///@}

///@{
/**
* <p>The unique identifier of the updated library item.</p>
*/
inline const Aws::String& GetLibraryItemId() const{ return m_libraryItemId; }
inline bool LibraryItemIdHasBeenSet() const { return m_libraryItemIdHasBeenSet; }
inline void SetLibraryItemId(const Aws::String& value) { m_libraryItemIdHasBeenSet = true; m_libraryItemId = value; }
inline void SetLibraryItemId(Aws::String&& value) { m_libraryItemIdHasBeenSet = true; m_libraryItemId = std::move(value); }
inline void SetLibraryItemId(const char* value) { m_libraryItemIdHasBeenSet = true; m_libraryItemId.assign(value); }
inline UpdateLibraryItemMetadataRequest& WithLibraryItemId(const Aws::String& value) { SetLibraryItemId(value); return *this;}
inline UpdateLibraryItemMetadataRequest& WithLibraryItemId(Aws::String&& value) { SetLibraryItemId(std::move(value)); return *this;}
inline UpdateLibraryItemMetadataRequest& WithLibraryItemId(const char* value) { SetLibraryItemId(value); return *this;}
///@}

///@{
/**
* <p>The verification status of the library item</p>
*/
inline bool GetIsVerified() const{ return m_isVerified; }
inline bool IsVerifiedHasBeenSet() const { return m_isVerifiedHasBeenSet; }
inline void SetIsVerified(bool value) { m_isVerifiedHasBeenSet = true; m_isVerified = value; }
inline UpdateLibraryItemMetadataRequest& WithIsVerified(bool value) { SetIsVerified(value); return *this;}
///@}
private:

Aws::String m_instanceId;
bool m_instanceIdHasBeenSet = false;

Aws::String m_libraryItemId;
bool m_libraryItemIdHasBeenSet = false;

bool m_isVerified;
bool m_isVerifiedHasBeenSet = false;
};

} // namespace Model
} // namespace QApps
} // namespace Aws
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@ namespace Model
inline UpdateLibraryItemResult& WithUserCount(int value) { SetUserCount(value); return *this;}
///@}

///@{
/**
* <p>Indicates whether the library item has been verified.</p>
*/
inline bool GetIsVerified() const{ return m_isVerified; }
inline void SetIsVerified(bool value) { m_isVerified = value; }
inline UpdateLibraryItemResult& WithIsVerified(bool value) { SetIsVerified(value); return *this;}
///@}

///@{

inline const Aws::String& GetRequestId() const{ return m_requestId; }
Expand Down Expand Up @@ -207,6 +216,8 @@ namespace Model

int m_userCount;

bool m_isVerified;

Aws::String m_requestId;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ namespace Model
inline UserAppItem& WithStatus(Aws::String&& value) { SetStatus(std::move(value)); return *this;}
inline UserAppItem& WithStatus(const char* value) { SetStatus(value); return *this;}
///@}

///@{
/**
* <p>Indicates whether the Q App has been verified.</p>
*/
inline bool GetIsVerified() const{ return m_isVerified; }
inline bool IsVerifiedHasBeenSet() const { return m_isVerifiedHasBeenSet; }
inline void SetIsVerified(bool value) { m_isVerifiedHasBeenSet = true; m_isVerified = value; }
inline UserAppItem& WithIsVerified(bool value) { SetIsVerified(value); return *this;}
///@}
private:

Aws::String m_appId;
Expand All @@ -152,6 +162,9 @@ namespace Model

Aws::String m_status;
bool m_statusHasBeenSet = false;

bool m_isVerified;
bool m_isVerifiedHasBeenSet = false;
};

} // namespace Model
Expand Down
33 changes: 33 additions & 0 deletions generated/src/aws-cpp-sdk-qapps/source/QAppsClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <aws/qapps/model/TagResourceRequest.h>
#include <aws/qapps/model/UntagResourceRequest.h>
#include <aws/qapps/model/UpdateLibraryItemRequest.h>
#include <aws/qapps/model/UpdateLibraryItemMetadataRequest.h>
#include <aws/qapps/model/UpdateQAppRequest.h>
#include <aws/qapps/model/UpdateQAppSessionRequest.h>

Expand Down Expand Up @@ -882,6 +883,38 @@ UpdateLibraryItemOutcome QAppsClient::UpdateLibraryItem(const UpdateLibraryItemR
{{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}});
}

UpdateLibraryItemMetadataOutcome QAppsClient::UpdateLibraryItemMetadata(const UpdateLibraryItemMetadataRequest& request) const
{
AWS_OPERATION_GUARD(UpdateLibraryItemMetadata);
AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateLibraryItemMetadata, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE);
if (!request.InstanceIdHasBeenSet())
{
AWS_LOGSTREAM_ERROR("UpdateLibraryItemMetadata", "Required field: InstanceId, is not set");
return UpdateLibraryItemMetadataOutcome(Aws::Client::AWSError<QAppsErrors>(QAppsErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [InstanceId]", false));
}
AWS_OPERATION_CHECK_PTR(m_telemetryProvider, UpdateLibraryItemMetadata, CoreErrors, CoreErrors::NOT_INITIALIZED);
auto tracer = m_telemetryProvider->getTracer(this->GetServiceClientName(), {});
auto meter = m_telemetryProvider->getMeter(this->GetServiceClientName(), {});
AWS_OPERATION_CHECK_PTR(meter, UpdateLibraryItemMetadata, CoreErrors, CoreErrors::NOT_INITIALIZED);
auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateLibraryItemMetadata",
{{ TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName() }, { TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName() }, { TracingUtils::SMITHY_SYSTEM_DIMENSION, TracingUtils::SMITHY_METHOD_AWS_VALUE }},
smithy::components::tracing::SpanKind::CLIENT);
return TracingUtils::MakeCallWithTiming<UpdateLibraryItemMetadataOutcome>(
[&]()-> UpdateLibraryItemMetadataOutcome {
auto endpointResolutionOutcome = TracingUtils::MakeCallWithTiming<ResolveEndpointOutcome>(
[&]() -> ResolveEndpointOutcome { return m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams()); },
TracingUtils::SMITHY_CLIENT_ENDPOINT_RESOLUTION_METRIC,
*meter,
{{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}});
AWS_OPERATION_CHECK_SUCCESS(endpointResolutionOutcome, UpdateLibraryItemMetadata, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE, endpointResolutionOutcome.GetError().GetMessage());
endpointResolutionOutcome.GetResult().AddPathSegments("/catalog.updateItemMetadata");
return UpdateLibraryItemMetadataOutcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
},
TracingUtils::SMITHY_CLIENT_DURATION_METRIC,
*meter,
{{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}});
}

UpdateQAppOutcome QAppsClient::UpdateQApp(const UpdateQAppRequest& request) const
{
AWS_OPERATION_GUARD(UpdateQApp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ using namespace Aws::Utils;
using namespace Aws;

CreateLibraryItemResult::CreateLibraryItemResult() :
m_ratingCount(0)
m_ratingCount(0),
m_isVerified(false)
{
}

Expand Down Expand Up @@ -73,6 +74,12 @@ CreateLibraryItemResult& CreateLibraryItemResult::operator =(const Aws::AmazonWe

}

if(jsonValue.ValueExists("isVerified"))
{
m_isVerified = jsonValue.GetBool("isVerified");

}


const auto& headers = result.GetHeaderValueCollection();
const auto& requestIdIter = headers.find("x-amzn-requestid");
Expand Down
Loading

0 comments on commit af8d1fb

Please sign in to comment.