diff --git a/generated/src/aws-cpp-sdk-bedrock-agent-runtime/include/aws/bedrock-agent-runtime/BedrockAgentRuntimeClient.h b/generated/src/aws-cpp-sdk-bedrock-agent-runtime/include/aws/bedrock-agent-runtime/BedrockAgentRuntimeClient.h index 266da9e10fae..ac9d99dcbe42 100644 --- a/generated/src/aws-cpp-sdk-bedrock-agent-runtime/include/aws/bedrock-agent-runtime/BedrockAgentRuntimeClient.h +++ b/generated/src/aws-cpp-sdk-bedrock-agent-runtime/include/aws/bedrock-agent-runtime/BedrockAgentRuntimeClient.h @@ -1069,6 +1069,12 @@ class AWS_BEDROCKAGENTRUNTIME_API BedrockAgentRuntimeClient private: friend class Aws::Client::ClientWithAsyncTemplateMethods; + + typedef Aws::Utils::Outcome, BedrockAgentRuntimeError> InvokeOperationOutcome; + + InvokeOperationOutcome InvokeServiceOperation(const AmazonWebServiceRequest& request, + const std::function& resolveUri, + Aws::Http::HttpMethod httpMethod) const; }; } // namespace BedrockAgentRuntime diff --git a/generated/src/aws-cpp-sdk-bedrock-agent-runtime/source/BedrockAgentRuntimeClient.cpp b/generated/src/aws-cpp-sdk-bedrock-agent-runtime/source/BedrockAgentRuntimeClient.cpp index a4ec3c1d8b26..c7f113e9581b 100644 --- a/generated/src/aws-cpp-sdk-bedrock-agent-runtime/source/BedrockAgentRuntimeClient.cpp +++ b/generated/src/aws-cpp-sdk-bedrock-agent-runtime/source/BedrockAgentRuntimeClient.cpp @@ -168,67 +168,61 @@ void BedrockAgentRuntimeClient::OverrideEndpoint(const Aws::String& endpoint) { m_clientConfiguration.endpointOverride = endpoint; m_endpointProvider->OverrideEndpoint(endpoint); } +BedrockAgentRuntimeClient::InvokeOperationOutcome BedrockAgentRuntimeClient::InvokeServiceOperation( + const AmazonWebServiceRequest& request, const std::function& resolveUri, + Aws::Http::HttpMethod httpMethod) const { + auto operationName = request.GetServiceRequestName(); + auto serviceName = GetServiceClientName(); + + AWS_OPERATION_GUARD_DYNAMIC(operationName); + + AWS_OPERATION_CHECK_PTR_DYNAMIC(m_clientConfiguration.telemetryProvider, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto tracer = m_clientConfiguration.telemetryProvider->getTracer(serviceName, {}); + auto meter = m_clientConfiguration.telemetryProvider->getMeter(serviceName, {}); + AWS_OPERATION_CHECK_PTR_DYNAMIC(meter, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto span = tracer->CreateSpan(Aws::String(serviceName) + "." + operationName, + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, + {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}, + {TracingUtils::SMITHY_SYSTEM_DIMENSION, TracingUtils::SMITHY_METHOD_AWS_VALUE}}, + smithy::components::tracing::SpanKind::CLIENT); + + return TracingUtils::MakeCallWithTiming( + [&]() -> InvokeOperationOutcome { + auto result = MakeRequestDeserialize(&request, operationName, httpMethod, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolveUri(resolvedEndpoint); }); + return result.IsSuccess() ? InvokeOperationOutcome(result.GetResultWithOwnership()) + : InvokeOperationOutcome(std::move(result.GetError())); + }, + TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}}); +} CreateInvocationOutcome BedrockAgentRuntimeClient::CreateInvocation(const CreateInvocationRequest& request) const { - AWS_OPERATION_GUARD(CreateInvocation); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateInvocation, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.SessionIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("CreateInvocation", "Required field: SessionIdentifier, is not set"); return CreateInvocationOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [SessionIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateInvocation, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateInvocation, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateInvocation", - {{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( - [&]() -> CreateInvocationOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/sessions/"); - resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); - resolvedEndpoint.AddPathSegments("/invocations/"); - }); - return result.IsSuccess() ? CreateInvocationOutcome(result.GetResultWithOwnership()) - : CreateInvocationOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/sessions/"); + resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); + resolvedEndpoint.AddPathSegments("/invocations/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? CreateInvocationOutcome(result.GetResultWithOwnership()) + : CreateInvocationOutcome(std::move(result.GetError())); } - CreateSessionOutcome BedrockAgentRuntimeClient::CreateSession(const CreateSessionRequest& request) const { - AWS_OPERATION_GUARD(CreateSession); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateSession, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateSession, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateSession, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateSession", - {{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( - [&]() -> CreateSessionOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/sessions/"); }); - return result.IsSuccess() ? CreateSessionOutcome(result.GetResultWithOwnership()) - : CreateSessionOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/sessions/"); }, + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? CreateSessionOutcome(result.GetResultWithOwnership()) : CreateSessionOutcome(std::move(result.GetError())); } - DeleteAgentMemoryOutcome BedrockAgentRuntimeClient::DeleteAgentMemory(const DeleteAgentMemoryRequest& request) const { - AWS_OPERATION_GUARD(DeleteAgentMemory); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteAgentMemory, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentAliasIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteAgentMemory", "Required field: AgentAliasId, is not set"); return DeleteAgentMemoryOutcome(Aws::Client::AWSError( @@ -239,124 +233,59 @@ DeleteAgentMemoryOutcome BedrockAgentRuntimeClient::DeleteAgentMemory(const Dele return DeleteAgentMemoryOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteAgentMemory, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteAgentMemory, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteAgentMemory", - {{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( - [&]() -> DeleteAgentMemoryOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentAliases/"); - resolvedEndpoint.AddPathSegment(request.GetAgentAliasId()); - resolvedEndpoint.AddPathSegments("/memories"); - }); - return result.IsSuccess() ? DeleteAgentMemoryOutcome(result.GetResultWithOwnership()) - : DeleteAgentMemoryOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentAliases/"); + resolvedEndpoint.AddPathSegment(request.GetAgentAliasId()); + resolvedEndpoint.AddPathSegments("/memories"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteAgentMemoryOutcome(result.GetResultWithOwnership()) + : DeleteAgentMemoryOutcome(std::move(result.GetError())); } - DeleteSessionOutcome BedrockAgentRuntimeClient::DeleteSession(const DeleteSessionRequest& request) const { - AWS_OPERATION_GUARD(DeleteSession); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteSession, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.SessionIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteSession", "Required field: SessionIdentifier, is not set"); return DeleteSessionOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [SessionIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteSession, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteSession, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteSession", - {{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( - [&]() -> DeleteSessionOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/sessions/"); - resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); - }); - return result.IsSuccess() ? DeleteSessionOutcome(result.GetResultWithOwnership()) - : DeleteSessionOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/sessions/"); + resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteSessionOutcome(result.GetResultWithOwnership()) : DeleteSessionOutcome(std::move(result.GetError())); } - EndSessionOutcome BedrockAgentRuntimeClient::EndSession(const EndSessionRequest& request) const { - AWS_OPERATION_GUARD(EndSession); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, EndSession, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.SessionIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("EndSession", "Required field: SessionIdentifier, is not set"); return EndSessionOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [SessionIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, EndSession, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, EndSession, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".EndSession", - {{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( - [&]() -> EndSessionOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PATCH, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/sessions/"); - resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); - }); - return result.IsSuccess() ? EndSessionOutcome(result.GetResultWithOwnership()) : EndSessionOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/sessions/"); + resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PATCH); + return result.IsSuccess() ? EndSessionOutcome(result.GetResultWithOwnership()) : EndSessionOutcome(std::move(result.GetError())); } - GenerateQueryOutcome BedrockAgentRuntimeClient::GenerateQuery(const GenerateQueryRequest& request) const { - AWS_OPERATION_GUARD(GenerateQuery); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GenerateQuery, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GenerateQuery, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GenerateQuery, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GenerateQuery", - {{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( - [&]() -> GenerateQueryOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/generateQuery"); }); - return result.IsSuccess() ? GenerateQueryOutcome(result.GetResultWithOwnership()) - : GenerateQueryOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/generateQuery"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GenerateQueryOutcome(result.GetResultWithOwnership()) : GenerateQueryOutcome(std::move(result.GetError())); } - GetAgentMemoryOutcome BedrockAgentRuntimeClient::GetAgentMemory(const GetAgentMemoryRequest& request) const { - AWS_OPERATION_GUARD(GetAgentMemory); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetAgentMemory, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentAliasIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetAgentMemory", "Required field: AgentAliasId, is not set"); return GetAgentMemoryOutcome(Aws::Client::AWSError( @@ -377,36 +306,20 @@ GetAgentMemoryOutcome BedrockAgentRuntimeClient::GetAgentMemory(const GetAgentMe return GetAgentMemoryOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [MemoryType]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetAgentMemory, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetAgentMemory, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetAgentMemory", - {{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( - [&]() -> GetAgentMemoryOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentAliases/"); - resolvedEndpoint.AddPathSegment(request.GetAgentAliasId()); - resolvedEndpoint.AddPathSegments("/memories"); - }); - return result.IsSuccess() ? GetAgentMemoryOutcome(result.GetResultWithOwnership()) - : GetAgentMemoryOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentAliases/"); + resolvedEndpoint.AddPathSegment(request.GetAgentAliasId()); + resolvedEndpoint.AddPathSegments("/memories"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetAgentMemoryOutcome(result.GetResultWithOwnership()) : GetAgentMemoryOutcome(std::move(result.GetError())); } - GetExecutionFlowSnapshotOutcome BedrockAgentRuntimeClient::GetExecutionFlowSnapshot(const GetExecutionFlowSnapshotRequest& request) const { - AWS_OPERATION_GUARD(GetExecutionFlowSnapshot); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetExecutionFlowSnapshot, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ExecutionIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetExecutionFlowSnapshot", "Required field: ExecutionIdentifier, is not set"); return GetExecutionFlowSnapshotOutcome(Aws::Client::AWSError( @@ -422,38 +335,23 @@ GetExecutionFlowSnapshotOutcome BedrockAgentRuntimeClient::GetExecutionFlowSnaps return GetExecutionFlowSnapshotOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [FlowIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetExecutionFlowSnapshot, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetExecutionFlowSnapshot, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetExecutionFlowSnapshot", - {{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( - [&]() -> GetExecutionFlowSnapshotOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - resolvedEndpoint.AddPathSegments("/aliases/"); - resolvedEndpoint.AddPathSegment(request.GetFlowAliasIdentifier()); - resolvedEndpoint.AddPathSegments("/executions/"); - resolvedEndpoint.AddPathSegment(request.GetExecutionIdentifier()); - resolvedEndpoint.AddPathSegments("/flowsnapshot"); - }); - return result.IsSuccess() ? GetExecutionFlowSnapshotOutcome(result.GetResultWithOwnership()) - : GetExecutionFlowSnapshotOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); + resolvedEndpoint.AddPathSegments("/aliases/"); + resolvedEndpoint.AddPathSegment(request.GetFlowAliasIdentifier()); + resolvedEndpoint.AddPathSegments("/executions/"); + resolvedEndpoint.AddPathSegment(request.GetExecutionIdentifier()); + resolvedEndpoint.AddPathSegments("/flowsnapshot"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetExecutionFlowSnapshotOutcome(result.GetResultWithOwnership()) + : GetExecutionFlowSnapshotOutcome(std::move(result.GetError())); } - GetFlowExecutionOutcome BedrockAgentRuntimeClient::GetFlowExecution(const GetFlowExecutionRequest& request) const { - AWS_OPERATION_GUARD(GetFlowExecution); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetFlowExecution, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ExecutionIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetFlowExecution", "Required field: ExecutionIdentifier, is not set"); return GetFlowExecutionOutcome(Aws::Client::AWSError( @@ -469,37 +367,22 @@ GetFlowExecutionOutcome BedrockAgentRuntimeClient::GetFlowExecution(const GetFlo return GetFlowExecutionOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [FlowIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetFlowExecution, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetFlowExecution, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetFlowExecution", - {{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( - [&]() -> GetFlowExecutionOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - resolvedEndpoint.AddPathSegments("/aliases/"); - resolvedEndpoint.AddPathSegment(request.GetFlowAliasIdentifier()); - resolvedEndpoint.AddPathSegments("/executions/"); - resolvedEndpoint.AddPathSegment(request.GetExecutionIdentifier()); - }); - return result.IsSuccess() ? GetFlowExecutionOutcome(result.GetResultWithOwnership()) - : GetFlowExecutionOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); + resolvedEndpoint.AddPathSegments("/aliases/"); + resolvedEndpoint.AddPathSegment(request.GetFlowAliasIdentifier()); + resolvedEndpoint.AddPathSegments("/executions/"); + resolvedEndpoint.AddPathSegment(request.GetExecutionIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetFlowExecutionOutcome(result.GetResultWithOwnership()) + : GetFlowExecutionOutcome(std::move(result.GetError())); } - GetInvocationStepOutcome BedrockAgentRuntimeClient::GetInvocationStep(const GetInvocationStepRequest& request) const { - AWS_OPERATION_GUARD(GetInvocationStep); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetInvocationStep, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.InvocationStepIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetInvocationStep", "Required field: InvocationStepId, is not set"); return GetInvocationStepOutcome(Aws::Client::AWSError( @@ -510,63 +393,35 @@ GetInvocationStepOutcome BedrockAgentRuntimeClient::GetInvocationStep(const GetI return GetInvocationStepOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [SessionIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetInvocationStep, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetInvocationStep, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetInvocationStep", - {{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( - [&]() -> GetInvocationStepOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/sessions/"); - resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); - resolvedEndpoint.AddPathSegments("/invocationSteps/"); - resolvedEndpoint.AddPathSegment(request.GetInvocationStepId()); - }); - return result.IsSuccess() ? GetInvocationStepOutcome(result.GetResultWithOwnership()) - : GetInvocationStepOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/sessions/"); + resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); + resolvedEndpoint.AddPathSegments("/invocationSteps/"); + resolvedEndpoint.AddPathSegment(request.GetInvocationStepId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GetInvocationStepOutcome(result.GetResultWithOwnership()) + : GetInvocationStepOutcome(std::move(result.GetError())); } - GetSessionOutcome BedrockAgentRuntimeClient::GetSession(const GetSessionRequest& request) const { - AWS_OPERATION_GUARD(GetSession); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetSession, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.SessionIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetSession", "Required field: SessionIdentifier, is not set"); return GetSessionOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [SessionIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetSession, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetSession, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetSession", - {{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( - [&]() -> GetSessionOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/sessions/"); - resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); - }); - return result.IsSuccess() ? GetSessionOutcome(result.GetResultWithOwnership()) : GetSessionOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/sessions/"); + resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetSessionOutcome(result.GetResultWithOwnership()) : GetSessionOutcome(std::move(result.GetError())); } - InvokeAgentOutcome BedrockAgentRuntimeClient::InvokeAgent(InvokeAgentRequest& request) const { AWS_OPERATION_GUARD(InvokeAgent); AWS_OPERATION_CHECK_PTR(m_endpointProvider, InvokeAgent, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); @@ -624,7 +479,6 @@ InvokeAgentOutcome BedrockAgentRuntimeClient::InvokeAgent(InvokeAgentRequest& re {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); } - InvokeFlowOutcome BedrockAgentRuntimeClient::InvokeFlow(InvokeFlowRequest& request) const { AWS_OPERATION_GUARD(InvokeFlow); AWS_OPERATION_CHECK_PTR(m_endpointProvider, InvokeFlow, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); @@ -674,7 +528,6 @@ InvokeFlowOutcome BedrockAgentRuntimeClient::InvokeFlow(InvokeFlowRequest& reque {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); } - InvokeInlineAgentOutcome BedrockAgentRuntimeClient::InvokeInlineAgent(InvokeInlineAgentRequest& request) const { AWS_OPERATION_GUARD(InvokeInlineAgent); AWS_OPERATION_CHECK_PTR(m_endpointProvider, InvokeInlineAgent, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); @@ -718,10 +571,7 @@ InvokeInlineAgentOutcome BedrockAgentRuntimeClient::InvokeInlineAgent(InvokeInli {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); } - ListFlowExecutionEventsOutcome BedrockAgentRuntimeClient::ListFlowExecutionEvents(const ListFlowExecutionEventsRequest& request) const { - AWS_OPERATION_GUARD(ListFlowExecutionEvents); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListFlowExecutionEvents, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.EventTypeHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListFlowExecutionEvents", "Required field: EventType, is not set"); return ListFlowExecutionEventsOutcome(Aws::Client::AWSError( @@ -742,191 +592,99 @@ ListFlowExecutionEventsOutcome BedrockAgentRuntimeClient::ListFlowExecutionEvent return ListFlowExecutionEventsOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [FlowIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListFlowExecutionEvents, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListFlowExecutionEvents, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListFlowExecutionEvents", - {{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( - [&]() -> ListFlowExecutionEventsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - resolvedEndpoint.AddPathSegments("/aliases/"); - resolvedEndpoint.AddPathSegment(request.GetFlowAliasIdentifier()); - resolvedEndpoint.AddPathSegments("/executions/"); - resolvedEndpoint.AddPathSegment(request.GetExecutionIdentifier()); - resolvedEndpoint.AddPathSegments("/events"); - }); - return result.IsSuccess() ? ListFlowExecutionEventsOutcome(result.GetResultWithOwnership()) - : ListFlowExecutionEventsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); + resolvedEndpoint.AddPathSegments("/aliases/"); + resolvedEndpoint.AddPathSegment(request.GetFlowAliasIdentifier()); + resolvedEndpoint.AddPathSegments("/executions/"); + resolvedEndpoint.AddPathSegment(request.GetExecutionIdentifier()); + resolvedEndpoint.AddPathSegments("/events"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListFlowExecutionEventsOutcome(result.GetResultWithOwnership()) + : ListFlowExecutionEventsOutcome(std::move(result.GetError())); } - ListFlowExecutionsOutcome BedrockAgentRuntimeClient::ListFlowExecutions(const ListFlowExecutionsRequest& request) const { - AWS_OPERATION_GUARD(ListFlowExecutions); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListFlowExecutions, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.FlowIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListFlowExecutions", "Required field: FlowIdentifier, is not set"); return ListFlowExecutionsOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [FlowIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListFlowExecutions, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListFlowExecutions, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListFlowExecutions", - {{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( - [&]() -> ListFlowExecutionsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - resolvedEndpoint.AddPathSegments("/executions"); - }); - return result.IsSuccess() ? ListFlowExecutionsOutcome(result.GetResultWithOwnership()) - : ListFlowExecutionsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); + resolvedEndpoint.AddPathSegments("/executions"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListFlowExecutionsOutcome(result.GetResultWithOwnership()) + : ListFlowExecutionsOutcome(std::move(result.GetError())); } - ListInvocationStepsOutcome BedrockAgentRuntimeClient::ListInvocationSteps(const ListInvocationStepsRequest& request) const { - AWS_OPERATION_GUARD(ListInvocationSteps); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListInvocationSteps, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.SessionIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListInvocationSteps", "Required field: SessionIdentifier, is not set"); return ListInvocationStepsOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [SessionIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListInvocationSteps, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListInvocationSteps, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListInvocationSteps", - {{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( - [&]() -> ListInvocationStepsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/sessions/"); - resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); - resolvedEndpoint.AddPathSegments("/invocationSteps/"); - }); - return result.IsSuccess() ? ListInvocationStepsOutcome(result.GetResultWithOwnership()) - : ListInvocationStepsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/sessions/"); + resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); + resolvedEndpoint.AddPathSegments("/invocationSteps/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListInvocationStepsOutcome(result.GetResultWithOwnership()) + : ListInvocationStepsOutcome(std::move(result.GetError())); } - ListInvocationsOutcome BedrockAgentRuntimeClient::ListInvocations(const ListInvocationsRequest& request) const { - AWS_OPERATION_GUARD(ListInvocations); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListInvocations, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.SessionIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListInvocations", "Required field: SessionIdentifier, is not set"); return ListInvocationsOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [SessionIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListInvocations, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListInvocations, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListInvocations", - {{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( - [&]() -> ListInvocationsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/sessions/"); - resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); - resolvedEndpoint.AddPathSegments("/invocations/"); - }); - return result.IsSuccess() ? ListInvocationsOutcome(result.GetResultWithOwnership()) - : ListInvocationsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/sessions/"); + resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); + resolvedEndpoint.AddPathSegments("/invocations/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListInvocationsOutcome(result.GetResultWithOwnership()) + : ListInvocationsOutcome(std::move(result.GetError())); } - ListSessionsOutcome BedrockAgentRuntimeClient::ListSessions(const ListSessionsRequest& request) const { - AWS_OPERATION_GUARD(ListSessions); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListSessions, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListSessions, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListSessions, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListSessions", - {{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( - [&]() -> ListSessionsOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/sessions/"); }); - return result.IsSuccess() ? ListSessionsOutcome(result.GetResultWithOwnership()) - : ListSessionsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/sessions/"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListSessionsOutcome(result.GetResultWithOwnership()) : ListSessionsOutcome(std::move(result.GetError())); } - ListTagsForResourceOutcome BedrockAgentRuntimeClient::ListTagsForResource(const ListTagsForResourceRequest& request) const { - AWS_OPERATION_GUARD(ListTagsForResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListTagsForResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ResourceArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListTagsForResource", "Required field: ResourceArn, is not set"); return ListTagsForResourceOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ResourceArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListTagsForResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListTagsForResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListTagsForResource", - {{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( - [&]() -> ListTagsForResourceOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/tags/"); - resolvedEndpoint.AddPathSegment(request.GetResourceArn()); - }); - return result.IsSuccess() ? ListTagsForResourceOutcome(result.GetResultWithOwnership()) - : ListTagsForResourceOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/tags/"); + resolvedEndpoint.AddPathSegment(request.GetResourceArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListTagsForResourceOutcome(result.GetResultWithOwnership()) + : ListTagsForResourceOutcome(std::move(result.GetError())); } - OptimizePromptOutcome BedrockAgentRuntimeClient::OptimizePrompt(OptimizePromptRequest& request) const { AWS_OPERATION_GUARD(OptimizePrompt); AWS_OPERATION_CHECK_PTR(m_endpointProvider, OptimizePrompt, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); @@ -963,121 +721,54 @@ OptimizePromptOutcome BedrockAgentRuntimeClient::OptimizePrompt(OptimizePromptRe {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); } - PutInvocationStepOutcome BedrockAgentRuntimeClient::PutInvocationStep(const PutInvocationStepRequest& request) const { - AWS_OPERATION_GUARD(PutInvocationStep); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, PutInvocationStep, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.SessionIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("PutInvocationStep", "Required field: SessionIdentifier, is not set"); return PutInvocationStepOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [SessionIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, PutInvocationStep, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, PutInvocationStep, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".PutInvocationStep", - {{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( - [&]() -> PutInvocationStepOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/sessions/"); - resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); - resolvedEndpoint.AddPathSegments("/invocationSteps/"); - }); - return result.IsSuccess() ? PutInvocationStepOutcome(result.GetResultWithOwnership()) - : PutInvocationStepOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/sessions/"); + resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); + resolvedEndpoint.AddPathSegments("/invocationSteps/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? PutInvocationStepOutcome(result.GetResultWithOwnership()) + : PutInvocationStepOutcome(std::move(result.GetError())); } - RerankOutcome BedrockAgentRuntimeClient::Rerank(const RerankRequest& request) const { - AWS_OPERATION_GUARD(Rerank); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, Rerank, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, Rerank, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, Rerank, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".Rerank", - {{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( - [&]() -> RerankOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/rerank"); }); - return result.IsSuccess() ? RerankOutcome(result.GetResultWithOwnership()) : RerankOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/rerank"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? RerankOutcome(result.GetResultWithOwnership()) : RerankOutcome(std::move(result.GetError())); } - RetrieveOutcome BedrockAgentRuntimeClient::Retrieve(const RetrieveRequest& request) const { - AWS_OPERATION_GUARD(Retrieve); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, Retrieve, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.KnowledgeBaseIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("Retrieve", "Required field: KnowledgeBaseId, is not set"); return RetrieveOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [KnowledgeBaseId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, Retrieve, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, Retrieve, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".Retrieve", - {{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( - [&]() -> RetrieveOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - resolvedEndpoint.AddPathSegments("/retrieve"); - }); - return result.IsSuccess() ? RetrieveOutcome(result.GetResultWithOwnership()) : RetrieveOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); + resolvedEndpoint.AddPathSegments("/retrieve"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? RetrieveOutcome(result.GetResultWithOwnership()) : RetrieveOutcome(std::move(result.GetError())); } - RetrieveAndGenerateOutcome BedrockAgentRuntimeClient::RetrieveAndGenerate(const RetrieveAndGenerateRequest& request) const { - AWS_OPERATION_GUARD(RetrieveAndGenerate); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, RetrieveAndGenerate, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, RetrieveAndGenerate, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, RetrieveAndGenerate, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".RetrieveAndGenerate", - {{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( - [&]() -> RetrieveAndGenerateOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/retrieveAndGenerate"); }); - return result.IsSuccess() ? RetrieveAndGenerateOutcome(result.GetResultWithOwnership()) - : RetrieveAndGenerateOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/retrieveAndGenerate"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? RetrieveAndGenerateOutcome(result.GetResultWithOwnership()) + : RetrieveAndGenerateOutcome(std::move(result.GetError())); } - RetrieveAndGenerateStreamOutcome BedrockAgentRuntimeClient::RetrieveAndGenerateStream(RetrieveAndGenerateStreamRequest& request) const { AWS_OPERATION_GUARD(RetrieveAndGenerateStream); AWS_OPERATION_CHECK_PTR(m_endpointProvider, RetrieveAndGenerateStream, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); @@ -1114,10 +805,7 @@ RetrieveAndGenerateStreamOutcome BedrockAgentRuntimeClient::RetrieveAndGenerateS {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); } - StartFlowExecutionOutcome BedrockAgentRuntimeClient::StartFlowExecution(const StartFlowExecutionRequest& request) const { - AWS_OPERATION_GUARD(StartFlowExecution); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, StartFlowExecution, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.FlowAliasIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("StartFlowExecution", "Required field: FlowAliasIdentifier, is not set"); return StartFlowExecutionOutcome(Aws::Client::AWSError( @@ -1128,36 +816,21 @@ StartFlowExecutionOutcome BedrockAgentRuntimeClient::StartFlowExecution(const St return StartFlowExecutionOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [FlowIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, StartFlowExecution, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, StartFlowExecution, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".StartFlowExecution", - {{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( - [&]() -> StartFlowExecutionOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - resolvedEndpoint.AddPathSegments("/aliases/"); - resolvedEndpoint.AddPathSegment(request.GetFlowAliasIdentifier()); - resolvedEndpoint.AddPathSegments("/executions"); - }); - return result.IsSuccess() ? StartFlowExecutionOutcome(result.GetResultWithOwnership()) - : StartFlowExecutionOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); + resolvedEndpoint.AddPathSegments("/aliases/"); + resolvedEndpoint.AddPathSegment(request.GetFlowAliasIdentifier()); + resolvedEndpoint.AddPathSegments("/executions"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? StartFlowExecutionOutcome(result.GetResultWithOwnership()) + : StartFlowExecutionOutcome(std::move(result.GetError())); } - StopFlowExecutionOutcome BedrockAgentRuntimeClient::StopFlowExecution(const StopFlowExecutionRequest& request) const { - AWS_OPERATION_GUARD(StopFlowExecution); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, StopFlowExecution, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ExecutionIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("StopFlowExecution", "Required field: ExecutionIdentifier, is not set"); return StopFlowExecutionOutcome(Aws::Client::AWSError( @@ -1173,69 +846,39 @@ StopFlowExecutionOutcome BedrockAgentRuntimeClient::StopFlowExecution(const Stop return StopFlowExecutionOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [FlowIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, StopFlowExecution, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, StopFlowExecution, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".StopFlowExecution", - {{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( - [&]() -> StopFlowExecutionOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - resolvedEndpoint.AddPathSegments("/aliases/"); - resolvedEndpoint.AddPathSegment(request.GetFlowAliasIdentifier()); - resolvedEndpoint.AddPathSegments("/executions/"); - resolvedEndpoint.AddPathSegment(request.GetExecutionIdentifier()); - resolvedEndpoint.AddPathSegments("/stop"); - }); - return result.IsSuccess() ? StopFlowExecutionOutcome(result.GetResultWithOwnership()) - : StopFlowExecutionOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); + resolvedEndpoint.AddPathSegments("/aliases/"); + resolvedEndpoint.AddPathSegment(request.GetFlowAliasIdentifier()); + resolvedEndpoint.AddPathSegments("/executions/"); + resolvedEndpoint.AddPathSegment(request.GetExecutionIdentifier()); + resolvedEndpoint.AddPathSegments("/stop"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? StopFlowExecutionOutcome(result.GetResultWithOwnership()) + : StopFlowExecutionOutcome(std::move(result.GetError())); } - TagResourceOutcome BedrockAgentRuntimeClient::TagResource(const TagResourceRequest& request) const { - AWS_OPERATION_GUARD(TagResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, TagResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ResourceArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("TagResource", "Required field: ResourceArn, is not set"); return TagResourceOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ResourceArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, TagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, TagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".TagResource", - {{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( - [&]() -> TagResourceOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/tags/"); - resolvedEndpoint.AddPathSegment(request.GetResourceArn()); - }); - return result.IsSuccess() ? TagResourceOutcome(result.GetResultWithOwnership()) : TagResourceOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/tags/"); + resolvedEndpoint.AddPathSegment(request.GetResourceArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? TagResourceOutcome(result.GetResultWithOwnership()) : TagResourceOutcome(std::move(result.GetError())); } - UntagResourceOutcome BedrockAgentRuntimeClient::UntagResource(const UntagResourceRequest& request) const { - AWS_OPERATION_GUARD(UntagResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UntagResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ResourceArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("UntagResource", "Required field: ResourceArn, is not set"); return UntagResourceOutcome(Aws::Client::AWSError( @@ -1246,58 +889,29 @@ UntagResourceOutcome BedrockAgentRuntimeClient::UntagResource(const UntagResourc return UntagResourceOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [TagKeys]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UntagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UntagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UntagResource", - {{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( - [&]() -> UntagResourceOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/tags/"); - resolvedEndpoint.AddPathSegment(request.GetResourceArn()); - }); - return result.IsSuccess() ? UntagResourceOutcome(result.GetResultWithOwnership()) - : UntagResourceOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/tags/"); + resolvedEndpoint.AddPathSegment(request.GetResourceArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? UntagResourceOutcome(result.GetResultWithOwnership()) : UntagResourceOutcome(std::move(result.GetError())); } - UpdateSessionOutcome BedrockAgentRuntimeClient::UpdateSession(const UpdateSessionRequest& request) const { - AWS_OPERATION_GUARD(UpdateSession); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateSession, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.SessionIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateSession", "Required field: SessionIdentifier, is not set"); return UpdateSessionOutcome(Aws::Client::AWSError( BedrockAgentRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [SessionIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateSession, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateSession, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateSession", - {{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( - [&]() -> UpdateSessionOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/sessions/"); - resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); - }); - return result.IsSuccess() ? UpdateSessionOutcome(result.GetResultWithOwnership()) - : UpdateSessionOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/sessions/"); + resolvedEndpoint.AddPathSegment(request.GetSessionIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? UpdateSessionOutcome(result.GetResultWithOwnership()) : UpdateSessionOutcome(std::move(result.GetError())); } diff --git a/generated/src/aws-cpp-sdk-bedrock-agent/include/aws/bedrock-agent/BedrockAgentClient.h b/generated/src/aws-cpp-sdk-bedrock-agent/include/aws/bedrock-agent/BedrockAgentClient.h index 8f69dc188df6..5507f4df1d6c 100644 --- a/generated/src/aws-cpp-sdk-bedrock-agent/include/aws/bedrock-agent/BedrockAgentClient.h +++ b/generated/src/aws-cpp-sdk-bedrock-agent/include/aws/bedrock-agent/BedrockAgentClient.h @@ -2187,6 +2187,12 @@ class AWS_BEDROCKAGENT_API BedrockAgentClient private: friend class Aws::Client::ClientWithAsyncTemplateMethods; + + typedef Aws::Utils::Outcome, BedrockAgentError> InvokeOperationOutcome; + + InvokeOperationOutcome InvokeServiceOperation(const AmazonWebServiceRequest& request, + const std::function& resolveUri, + Aws::Http::HttpMethod httpMethod) const; }; } // namespace BedrockAgent diff --git a/generated/src/aws-cpp-sdk-bedrock-agent/source/BedrockAgentClient.cpp b/generated/src/aws-cpp-sdk-bedrock-agent/source/BedrockAgentClient.cpp index 344f6cd9f277..f44f7da0d5d0 100644 --- a/generated/src/aws-cpp-sdk-bedrock-agent/source/BedrockAgentClient.cpp +++ b/generated/src/aws-cpp-sdk-bedrock-agent/source/BedrockAgentClient.cpp @@ -204,9 +204,37 @@ void BedrockAgentClient::OverrideEndpoint(const Aws::String& endpoint) { m_clientConfiguration.endpointOverride = endpoint; m_endpointProvider->OverrideEndpoint(endpoint); } +BedrockAgentClient::InvokeOperationOutcome BedrockAgentClient::InvokeServiceOperation( + const AmazonWebServiceRequest& request, const std::function& resolveUri, + Aws::Http::HttpMethod httpMethod) const { + auto operationName = request.GetServiceRequestName(); + auto serviceName = GetServiceClientName(); + + AWS_OPERATION_GUARD_DYNAMIC(operationName); + + AWS_OPERATION_CHECK_PTR_DYNAMIC(m_clientConfiguration.telemetryProvider, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto tracer = m_clientConfiguration.telemetryProvider->getTracer(serviceName, {}); + auto meter = m_clientConfiguration.telemetryProvider->getMeter(serviceName, {}); + AWS_OPERATION_CHECK_PTR_DYNAMIC(meter, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto span = tracer->CreateSpan(Aws::String(serviceName) + "." + operationName, + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, + {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}, + {TracingUtils::SMITHY_SYSTEM_DIMENSION, TracingUtils::SMITHY_METHOD_AWS_VALUE}}, + smithy::components::tracing::SpanKind::CLIENT); + + return TracingUtils::MakeCallWithTiming( + [&]() -> InvokeOperationOutcome { + auto result = MakeRequestDeserialize(&request, operationName, httpMethod, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolveUri(resolvedEndpoint); }); + return result.IsSuccess() ? InvokeOperationOutcome(result.GetResultWithOwnership()) + : InvokeOperationOutcome(std::move(result.GetError())); + }, + TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}}); +} AssociateAgentCollaboratorOutcome BedrockAgentClient::AssociateAgentCollaborator(const AssociateAgentCollaboratorRequest& request) const { - AWS_OPERATION_GUARD(AssociateAgentCollaborator); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, AssociateAgentCollaborator, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("AssociateAgentCollaborator", "Required field: AgentId, is not set"); return AssociateAgentCollaboratorOutcome(Aws::Client::AWSError( @@ -217,37 +245,22 @@ AssociateAgentCollaboratorOutcome BedrockAgentClient::AssociateAgentCollaborator return AssociateAgentCollaboratorOutcome(Aws::Client::AWSError( BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentVersion]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, AssociateAgentCollaborator, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, AssociateAgentCollaborator, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".AssociateAgentCollaborator", - {{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( - [&]() -> AssociateAgentCollaboratorOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); - resolvedEndpoint.AddPathSegments("/agentcollaborators/"); - }); - return result.IsSuccess() ? AssociateAgentCollaboratorOutcome(result.GetResultWithOwnership()) - : AssociateAgentCollaboratorOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); + resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); + resolvedEndpoint.AddPathSegments("/agentcollaborators/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? AssociateAgentCollaboratorOutcome(result.GetResultWithOwnership()) + : AssociateAgentCollaboratorOutcome(std::move(result.GetError())); } - AssociateAgentKnowledgeBaseOutcome BedrockAgentClient::AssociateAgentKnowledgeBase( const AssociateAgentKnowledgeBaseRequest& request) const { - AWS_OPERATION_GUARD(AssociateAgentKnowledgeBase); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, AssociateAgentKnowledgeBase, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("AssociateAgentKnowledgeBase", "Required field: AgentId, is not set"); return AssociateAgentKnowledgeBaseOutcome(Aws::Client::AWSError( @@ -258,60 +271,27 @@ AssociateAgentKnowledgeBaseOutcome BedrockAgentClient::AssociateAgentKnowledgeBa return AssociateAgentKnowledgeBaseOutcome(Aws::Client::AWSError( BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentVersion]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, AssociateAgentKnowledgeBase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, AssociateAgentKnowledgeBase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".AssociateAgentKnowledgeBase", - {{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( - [&]() -> AssociateAgentKnowledgeBaseOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - }); - return result.IsSuccess() ? AssociateAgentKnowledgeBaseOutcome(result.GetResultWithOwnership()) - : AssociateAgentKnowledgeBaseOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); + resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); + resolvedEndpoint.AddPathSegments("/knowledgebases/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? AssociateAgentKnowledgeBaseOutcome(result.GetResultWithOwnership()) + : AssociateAgentKnowledgeBaseOutcome(std::move(result.GetError())); } - CreateAgentOutcome BedrockAgentClient::CreateAgent(const CreateAgentRequest& request) const { - AWS_OPERATION_GUARD(CreateAgent); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateAgent, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateAgent, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateAgent, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateAgent", - {{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( - [&]() -> CreateAgentOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/agents/"); }); - return result.IsSuccess() ? CreateAgentOutcome(result.GetResultWithOwnership()) : CreateAgentOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/agents/"); }, + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? CreateAgentOutcome(result.GetResultWithOwnership()) : CreateAgentOutcome(std::move(result.GetError())); } - CreateAgentActionGroupOutcome BedrockAgentClient::CreateAgentActionGroup(const CreateAgentActionGroupRequest& request) const { - AWS_OPERATION_GUARD(CreateAgentActionGroup); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateAgentActionGroup, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("CreateAgentActionGroup", "Required field: AgentId, is not set"); return CreateAgentActionGroupOutcome(Aws::Client::AWSError( @@ -322,306 +302,146 @@ CreateAgentActionGroupOutcome BedrockAgentClient::CreateAgentActionGroup(const C return CreateAgentActionGroupOutcome(Aws::Client::AWSError( BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentVersion]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateAgentActionGroup, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateAgentActionGroup, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateAgentActionGroup", - {{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( - [&]() -> CreateAgentActionGroupOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); - resolvedEndpoint.AddPathSegments("/actiongroups/"); - }); - return result.IsSuccess() ? CreateAgentActionGroupOutcome(result.GetResultWithOwnership()) - : CreateAgentActionGroupOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); + resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); + resolvedEndpoint.AddPathSegments("/actiongroups/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? CreateAgentActionGroupOutcome(result.GetResultWithOwnership()) + : CreateAgentActionGroupOutcome(std::move(result.GetError())); } - CreateAgentAliasOutcome BedrockAgentClient::CreateAgentAlias(const CreateAgentAliasRequest& request) const { - AWS_OPERATION_GUARD(CreateAgentAlias); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateAgentAlias, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("CreateAgentAlias", "Required field: AgentId, is not set"); return CreateAgentAliasOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateAgentAlias, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateAgentAlias, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateAgentAlias", - {{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( - [&]() -> CreateAgentAliasOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentaliases/"); - }); - return result.IsSuccess() ? CreateAgentAliasOutcome(result.GetResultWithOwnership()) - : CreateAgentAliasOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentaliases/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? CreateAgentAliasOutcome(result.GetResultWithOwnership()) + : CreateAgentAliasOutcome(std::move(result.GetError())); } - CreateDataSourceOutcome BedrockAgentClient::CreateDataSource(const CreateDataSourceRequest& request) const { - AWS_OPERATION_GUARD(CreateDataSource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateDataSource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.KnowledgeBaseIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("CreateDataSource", "Required field: KnowledgeBaseId, is not set"); return CreateDataSourceOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [KnowledgeBaseId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateDataSource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateDataSource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateDataSource", - {{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( - [&]() -> CreateDataSourceOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - resolvedEndpoint.AddPathSegments("/datasources/"); - }); - return result.IsSuccess() ? CreateDataSourceOutcome(result.GetResultWithOwnership()) - : CreateDataSourceOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); + resolvedEndpoint.AddPathSegments("/datasources/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? CreateDataSourceOutcome(result.GetResultWithOwnership()) + : CreateDataSourceOutcome(std::move(result.GetError())); } - CreateFlowOutcome BedrockAgentClient::CreateFlow(const CreateFlowRequest& request) const { - AWS_OPERATION_GUARD(CreateFlow); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateFlow, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateFlow, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateFlow, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateFlow", - {{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( - [&]() -> CreateFlowOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/flows/"); }); - return result.IsSuccess() ? CreateFlowOutcome(result.GetResultWithOwnership()) : CreateFlowOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/flows/"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateFlowOutcome(result.GetResultWithOwnership()) : CreateFlowOutcome(std::move(result.GetError())); } - CreateFlowAliasOutcome BedrockAgentClient::CreateFlowAlias(const CreateFlowAliasRequest& request) const { - AWS_OPERATION_GUARD(CreateFlowAlias); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateFlowAlias, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.FlowIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("CreateFlowAlias", "Required field: FlowIdentifier, is not set"); return CreateFlowAliasOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [FlowIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateFlowAlias, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateFlowAlias, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateFlowAlias", - {{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( - [&]() -> CreateFlowAliasOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - resolvedEndpoint.AddPathSegments("/aliases"); - }); - return result.IsSuccess() ? CreateFlowAliasOutcome(result.GetResultWithOwnership()) - : CreateFlowAliasOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); + resolvedEndpoint.AddPathSegments("/aliases"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateFlowAliasOutcome(result.GetResultWithOwnership()) + : CreateFlowAliasOutcome(std::move(result.GetError())); } - CreateFlowVersionOutcome BedrockAgentClient::CreateFlowVersion(const CreateFlowVersionRequest& request) const { - AWS_OPERATION_GUARD(CreateFlowVersion); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateFlowVersion, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.FlowIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("CreateFlowVersion", "Required field: FlowIdentifier, is not set"); return CreateFlowVersionOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [FlowIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateFlowVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateFlowVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateFlowVersion", - {{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( - [&]() -> CreateFlowVersionOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - resolvedEndpoint.AddPathSegments("/versions"); - }); - return result.IsSuccess() ? CreateFlowVersionOutcome(result.GetResultWithOwnership()) - : CreateFlowVersionOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); + resolvedEndpoint.AddPathSegments("/versions"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateFlowVersionOutcome(result.GetResultWithOwnership()) + : CreateFlowVersionOutcome(std::move(result.GetError())); } - CreateKnowledgeBaseOutcome BedrockAgentClient::CreateKnowledgeBase(const CreateKnowledgeBaseRequest& request) const { - AWS_OPERATION_GUARD(CreateKnowledgeBase); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateKnowledgeBase, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateKnowledgeBase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateKnowledgeBase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateKnowledgeBase", - {{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( - [&]() -> CreateKnowledgeBaseOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/knowledgebases/"); }); - return result.IsSuccess() ? CreateKnowledgeBaseOutcome(result.GetResultWithOwnership()) - : CreateKnowledgeBaseOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/knowledgebases/"); }, + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? CreateKnowledgeBaseOutcome(result.GetResultWithOwnership()) + : CreateKnowledgeBaseOutcome(std::move(result.GetError())); } - CreatePromptOutcome BedrockAgentClient::CreatePrompt(const CreatePromptRequest& request) const { - AWS_OPERATION_GUARD(CreatePrompt); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreatePrompt, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreatePrompt, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreatePrompt, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreatePrompt", - {{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( - [&]() -> CreatePromptOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/prompts/"); }); - return result.IsSuccess() ? CreatePromptOutcome(result.GetResultWithOwnership()) - : CreatePromptOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/prompts/"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreatePromptOutcome(result.GetResultWithOwnership()) : CreatePromptOutcome(std::move(result.GetError())); } - CreatePromptVersionOutcome BedrockAgentClient::CreatePromptVersion(const CreatePromptVersionRequest& request) const { - AWS_OPERATION_GUARD(CreatePromptVersion); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreatePromptVersion, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PromptIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("CreatePromptVersion", "Required field: PromptIdentifier, is not set"); return CreatePromptVersionOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [PromptIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreatePromptVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreatePromptVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreatePromptVersion", - {{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( - [&]() -> CreatePromptVersionOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/prompts/"); - resolvedEndpoint.AddPathSegment(request.GetPromptIdentifier()); - resolvedEndpoint.AddPathSegments("/versions"); - }); - return result.IsSuccess() ? CreatePromptVersionOutcome(result.GetResultWithOwnership()) - : CreatePromptVersionOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/prompts/"); + resolvedEndpoint.AddPathSegment(request.GetPromptIdentifier()); + resolvedEndpoint.AddPathSegments("/versions"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreatePromptVersionOutcome(result.GetResultWithOwnership()) + : CreatePromptVersionOutcome(std::move(result.GetError())); } - DeleteAgentOutcome BedrockAgentClient::DeleteAgent(const DeleteAgentRequest& request) const { - AWS_OPERATION_GUARD(DeleteAgent); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteAgent, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteAgent", "Required field: AgentId, is not set"); return DeleteAgentOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteAgent, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteAgent, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteAgent", - {{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( - [&]() -> DeleteAgentOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - }); - return result.IsSuccess() ? DeleteAgentOutcome(result.GetResultWithOwnership()) : DeleteAgentOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteAgentOutcome(result.GetResultWithOwnership()) : DeleteAgentOutcome(std::move(result.GetError())); } - DeleteAgentActionGroupOutcome BedrockAgentClient::DeleteAgentActionGroup(const DeleteAgentActionGroupRequest& request) const { - AWS_OPERATION_GUARD(DeleteAgentActionGroup); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteAgentActionGroup, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteAgentActionGroup", "Required field: AgentId, is not set"); return DeleteAgentActionGroupOutcome(Aws::Client::AWSError( @@ -637,37 +457,22 @@ DeleteAgentActionGroupOutcome BedrockAgentClient::DeleteAgentActionGroup(const D return DeleteAgentActionGroupOutcome(Aws::Client::AWSError( BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ActionGroupId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteAgentActionGroup, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteAgentActionGroup, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteAgentActionGroup", - {{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( - [&]() -> DeleteAgentActionGroupOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); - resolvedEndpoint.AddPathSegments("/actiongroups/"); - resolvedEndpoint.AddPathSegment(request.GetActionGroupId()); - }); - return result.IsSuccess() ? DeleteAgentActionGroupOutcome(result.GetResultWithOwnership()) - : DeleteAgentActionGroupOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); + resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); + resolvedEndpoint.AddPathSegments("/actiongroups/"); + resolvedEndpoint.AddPathSegment(request.GetActionGroupId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteAgentActionGroupOutcome(result.GetResultWithOwnership()) + : DeleteAgentActionGroupOutcome(std::move(result.GetError())); } - DeleteAgentAliasOutcome BedrockAgentClient::DeleteAgentAlias(const DeleteAgentAliasRequest& request) const { - AWS_OPERATION_GUARD(DeleteAgentAlias); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteAgentAlias, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteAgentAlias", "Required field: AgentId, is not set"); return DeleteAgentAliasOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -678,35 +483,20 @@ DeleteAgentAliasOutcome BedrockAgentClient::DeleteAgentAlias(const DeleteAgentAl return DeleteAgentAliasOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentAliasId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteAgentAlias, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteAgentAlias, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteAgentAlias", - {{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( - [&]() -> DeleteAgentAliasOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentaliases/"); - resolvedEndpoint.AddPathSegment(request.GetAgentAliasId()); - }); - return result.IsSuccess() ? DeleteAgentAliasOutcome(result.GetResultWithOwnership()) - : DeleteAgentAliasOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentaliases/"); + resolvedEndpoint.AddPathSegment(request.GetAgentAliasId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteAgentAliasOutcome(result.GetResultWithOwnership()) + : DeleteAgentAliasOutcome(std::move(result.GetError())); } - DeleteAgentVersionOutcome BedrockAgentClient::DeleteAgentVersion(const DeleteAgentVersionRequest& request) const { - AWS_OPERATION_GUARD(DeleteAgentVersion); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteAgentVersion, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteAgentVersion", "Required field: AgentId, is not set"); return DeleteAgentVersionOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -717,35 +507,20 @@ DeleteAgentVersionOutcome BedrockAgentClient::DeleteAgentVersion(const DeleteAge return DeleteAgentVersionOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentVersion]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteAgentVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteAgentVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteAgentVersion", - {{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( - [&]() -> DeleteAgentVersionOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); - }); - return result.IsSuccess() ? DeleteAgentVersionOutcome(result.GetResultWithOwnership()) - : DeleteAgentVersionOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); + resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteAgentVersionOutcome(result.GetResultWithOwnership()) + : DeleteAgentVersionOutcome(std::move(result.GetError())); } - DeleteDataSourceOutcome BedrockAgentClient::DeleteDataSource(const DeleteDataSourceRequest& request) const { - AWS_OPERATION_GUARD(DeleteDataSource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteDataSource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.KnowledgeBaseIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteDataSource", "Required field: KnowledgeBaseId, is not set"); return DeleteDataSourceOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -756,66 +531,36 @@ DeleteDataSourceOutcome BedrockAgentClient::DeleteDataSource(const DeleteDataSou return DeleteDataSourceOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [DataSourceId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteDataSource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteDataSource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteDataSource", - {{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( - [&]() -> DeleteDataSourceOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - resolvedEndpoint.AddPathSegments("/datasources/"); - resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); - }); - return result.IsSuccess() ? DeleteDataSourceOutcome(result.GetResultWithOwnership()) - : DeleteDataSourceOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); + resolvedEndpoint.AddPathSegments("/datasources/"); + resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteDataSourceOutcome(result.GetResultWithOwnership()) + : DeleteDataSourceOutcome(std::move(result.GetError())); } - DeleteFlowOutcome BedrockAgentClient::DeleteFlow(const DeleteFlowRequest& request) const { - AWS_OPERATION_GUARD(DeleteFlow); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteFlow, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.FlowIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteFlow", "Required field: FlowIdentifier, is not set"); return DeleteFlowOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [FlowIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteFlow, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteFlow, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteFlow", - {{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( - [&]() -> DeleteFlowOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - }); - return result.IsSuccess() ? DeleteFlowOutcome(result.GetResultWithOwnership()) : DeleteFlowOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteFlowOutcome(result.GetResultWithOwnership()) : DeleteFlowOutcome(std::move(result.GetError())); } - DeleteFlowAliasOutcome BedrockAgentClient::DeleteFlowAlias(const DeleteFlowAliasRequest& request) const { - AWS_OPERATION_GUARD(DeleteFlowAlias); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteFlowAlias, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.FlowIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteFlowAlias", "Required field: FlowIdentifier, is not set"); return DeleteFlowAliasOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -826,35 +571,20 @@ DeleteFlowAliasOutcome BedrockAgentClient::DeleteFlowAlias(const DeleteFlowAlias return DeleteFlowAliasOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AliasIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteFlowAlias, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteFlowAlias, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteFlowAlias", - {{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( - [&]() -> DeleteFlowAliasOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - resolvedEndpoint.AddPathSegments("/aliases/"); - resolvedEndpoint.AddPathSegment(request.GetAliasIdentifier()); - }); - return result.IsSuccess() ? DeleteFlowAliasOutcome(result.GetResultWithOwnership()) - : DeleteFlowAliasOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); + resolvedEndpoint.AddPathSegments("/aliases/"); + resolvedEndpoint.AddPathSegment(request.GetAliasIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteFlowAliasOutcome(result.GetResultWithOwnership()) + : DeleteFlowAliasOutcome(std::move(result.GetError())); } - DeleteFlowVersionOutcome BedrockAgentClient::DeleteFlowVersion(const DeleteFlowVersionRequest& request) const { - AWS_OPERATION_GUARD(DeleteFlowVersion); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteFlowVersion, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.FlowIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteFlowVersion", "Required field: FlowIdentifier, is not set"); return DeleteFlowVersionOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -865,68 +595,38 @@ DeleteFlowVersionOutcome BedrockAgentClient::DeleteFlowVersion(const DeleteFlowV return DeleteFlowVersionOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [FlowVersion]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteFlowVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteFlowVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteFlowVersion", - {{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( - [&]() -> DeleteFlowVersionOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - resolvedEndpoint.AddPathSegments("/versions/"); - resolvedEndpoint.AddPathSegment(request.GetFlowVersion()); - }); - return result.IsSuccess() ? DeleteFlowVersionOutcome(result.GetResultWithOwnership()) - : DeleteFlowVersionOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); + resolvedEndpoint.AddPathSegments("/versions/"); + resolvedEndpoint.AddPathSegment(request.GetFlowVersion()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteFlowVersionOutcome(result.GetResultWithOwnership()) + : DeleteFlowVersionOutcome(std::move(result.GetError())); } - DeleteKnowledgeBaseOutcome BedrockAgentClient::DeleteKnowledgeBase(const DeleteKnowledgeBaseRequest& request) const { - AWS_OPERATION_GUARD(DeleteKnowledgeBase); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteKnowledgeBase, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.KnowledgeBaseIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteKnowledgeBase", "Required field: KnowledgeBaseId, is not set"); return DeleteKnowledgeBaseOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [KnowledgeBaseId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteKnowledgeBase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteKnowledgeBase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteKnowledgeBase", - {{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( - [&]() -> DeleteKnowledgeBaseOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - }); - return result.IsSuccess() ? DeleteKnowledgeBaseOutcome(result.GetResultWithOwnership()) - : DeleteKnowledgeBaseOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteKnowledgeBaseOutcome(result.GetResultWithOwnership()) + : DeleteKnowledgeBaseOutcome(std::move(result.GetError())); } - DeleteKnowledgeBaseDocumentsOutcome BedrockAgentClient::DeleteKnowledgeBaseDocuments( const DeleteKnowledgeBaseDocumentsRequest& request) const { - AWS_OPERATION_GUARD(DeleteKnowledgeBaseDocuments); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteKnowledgeBaseDocuments, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.KnowledgeBaseIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteKnowledgeBaseDocuments", "Required field: KnowledgeBaseId, is not set"); return DeleteKnowledgeBaseDocumentsOutcome(Aws::Client::AWSError( @@ -937,69 +637,38 @@ DeleteKnowledgeBaseDocumentsOutcome BedrockAgentClient::DeleteKnowledgeBaseDocum return DeleteKnowledgeBaseDocumentsOutcome(Aws::Client::AWSError( BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [DataSourceId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteKnowledgeBaseDocuments, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteKnowledgeBaseDocuments, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteKnowledgeBaseDocuments", - {{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( - [&]() -> DeleteKnowledgeBaseDocumentsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - resolvedEndpoint.AddPathSegments("/datasources/"); - resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); - resolvedEndpoint.AddPathSegments("/documents/deleteDocuments"); - }); - return result.IsSuccess() ? DeleteKnowledgeBaseDocumentsOutcome(result.GetResultWithOwnership()) - : DeleteKnowledgeBaseDocumentsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); + resolvedEndpoint.AddPathSegments("/datasources/"); + resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); + resolvedEndpoint.AddPathSegments("/documents/deleteDocuments"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DeleteKnowledgeBaseDocumentsOutcome(result.GetResultWithOwnership()) + : DeleteKnowledgeBaseDocumentsOutcome(std::move(result.GetError())); } - DeletePromptOutcome BedrockAgentClient::DeletePrompt(const DeletePromptRequest& request) const { - AWS_OPERATION_GUARD(DeletePrompt); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeletePrompt, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PromptIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeletePrompt", "Required field: PromptIdentifier, is not set"); return DeletePromptOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [PromptIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeletePrompt, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeletePrompt, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeletePrompt", - {{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( - [&]() -> DeletePromptOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/prompts/"); - resolvedEndpoint.AddPathSegment(request.GetPromptIdentifier()); - }); - return result.IsSuccess() ? DeletePromptOutcome(result.GetResultWithOwnership()) - : DeletePromptOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/prompts/"); + resolvedEndpoint.AddPathSegment(request.GetPromptIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeletePromptOutcome(result.GetResultWithOwnership()) : DeletePromptOutcome(std::move(result.GetError())); } - DisassociateAgentCollaboratorOutcome BedrockAgentClient::DisassociateAgentCollaborator( const DisassociateAgentCollaboratorRequest& request) const { - AWS_OPERATION_GUARD(DisassociateAgentCollaborator); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DisassociateAgentCollaborator, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("DisassociateAgentCollaborator", "Required field: AgentId, is not set"); return DisassociateAgentCollaboratorOutcome(Aws::Client::AWSError( @@ -1015,38 +684,23 @@ DisassociateAgentCollaboratorOutcome BedrockAgentClient::DisassociateAgentCollab return DisassociateAgentCollaboratorOutcome(Aws::Client::AWSError( BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [CollaboratorId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DisassociateAgentCollaborator, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DisassociateAgentCollaborator, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DisassociateAgentCollaborator", - {{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( - [&]() -> DisassociateAgentCollaboratorOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); - resolvedEndpoint.AddPathSegments("/agentcollaborators/"); - resolvedEndpoint.AddPathSegment(request.GetCollaboratorId()); - }); - return result.IsSuccess() ? DisassociateAgentCollaboratorOutcome(result.GetResultWithOwnership()) - : DisassociateAgentCollaboratorOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); + resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); + resolvedEndpoint.AddPathSegments("/agentcollaborators/"); + resolvedEndpoint.AddPathSegment(request.GetCollaboratorId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DisassociateAgentCollaboratorOutcome(result.GetResultWithOwnership()) + : DisassociateAgentCollaboratorOutcome(std::move(result.GetError())); } - DisassociateAgentKnowledgeBaseOutcome BedrockAgentClient::DisassociateAgentKnowledgeBase( const DisassociateAgentKnowledgeBaseRequest& request) const { - AWS_OPERATION_GUARD(DisassociateAgentKnowledgeBase); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DisassociateAgentKnowledgeBase, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("DisassociateAgentKnowledgeBase", "Required field: AgentId, is not set"); return DisassociateAgentKnowledgeBaseOutcome(Aws::Client::AWSError( @@ -1062,68 +716,38 @@ DisassociateAgentKnowledgeBaseOutcome BedrockAgentClient::DisassociateAgentKnowl return DisassociateAgentKnowledgeBaseOutcome(Aws::Client::AWSError( BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [KnowledgeBaseId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DisassociateAgentKnowledgeBase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DisassociateAgentKnowledgeBase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DisassociateAgentKnowledgeBase", - {{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( - [&]() -> DisassociateAgentKnowledgeBaseOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - }); - return result.IsSuccess() ? DisassociateAgentKnowledgeBaseOutcome(result.GetResultWithOwnership()) - : DisassociateAgentKnowledgeBaseOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); + resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DisassociateAgentKnowledgeBaseOutcome(result.GetResultWithOwnership()) + : DisassociateAgentKnowledgeBaseOutcome(std::move(result.GetError())); } - GetAgentOutcome BedrockAgentClient::GetAgent(const GetAgentRequest& request) const { - AWS_OPERATION_GUARD(GetAgent); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetAgent, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetAgent", "Required field: AgentId, is not set"); return GetAgentOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetAgent, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetAgent, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetAgent", - {{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( - [&]() -> GetAgentOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - }); - return result.IsSuccess() ? GetAgentOutcome(result.GetResultWithOwnership()) : GetAgentOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetAgentOutcome(result.GetResultWithOwnership()) : GetAgentOutcome(std::move(result.GetError())); } - GetAgentActionGroupOutcome BedrockAgentClient::GetAgentActionGroup(const GetAgentActionGroupRequest& request) const { - AWS_OPERATION_GUARD(GetAgentActionGroup); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetAgentActionGroup, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetAgentActionGroup", "Required field: AgentId, is not set"); return GetAgentActionGroupOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -1139,37 +763,22 @@ GetAgentActionGroupOutcome BedrockAgentClient::GetAgentActionGroup(const GetAgen return GetAgentActionGroupOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ActionGroupId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetAgentActionGroup, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetAgentActionGroup, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetAgentActionGroup", - {{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( - [&]() -> GetAgentActionGroupOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); - resolvedEndpoint.AddPathSegments("/actiongroups/"); - resolvedEndpoint.AddPathSegment(request.GetActionGroupId()); - }); - return result.IsSuccess() ? GetAgentActionGroupOutcome(result.GetResultWithOwnership()) - : GetAgentActionGroupOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); + resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); + resolvedEndpoint.AddPathSegments("/actiongroups/"); + resolvedEndpoint.AddPathSegment(request.GetActionGroupId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetAgentActionGroupOutcome(result.GetResultWithOwnership()) + : GetAgentActionGroupOutcome(std::move(result.GetError())); } - GetAgentAliasOutcome BedrockAgentClient::GetAgentAlias(const GetAgentAliasRequest& request) const { - AWS_OPERATION_GUARD(GetAgentAlias); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetAgentAlias, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetAgentAlias", "Required field: AgentId, is not set"); return GetAgentAliasOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -1180,35 +789,19 @@ GetAgentAliasOutcome BedrockAgentClient::GetAgentAlias(const GetAgentAliasReques return GetAgentAliasOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentAliasId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetAgentAlias, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetAgentAlias, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetAgentAlias", - {{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( - [&]() -> GetAgentAliasOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentaliases/"); - resolvedEndpoint.AddPathSegment(request.GetAgentAliasId()); - }); - return result.IsSuccess() ? GetAgentAliasOutcome(result.GetResultWithOwnership()) - : GetAgentAliasOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentaliases/"); + resolvedEndpoint.AddPathSegment(request.GetAgentAliasId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetAgentAliasOutcome(result.GetResultWithOwnership()) : GetAgentAliasOutcome(std::move(result.GetError())); } - GetAgentCollaboratorOutcome BedrockAgentClient::GetAgentCollaborator(const GetAgentCollaboratorRequest& request) const { - AWS_OPERATION_GUARD(GetAgentCollaborator); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetAgentCollaborator, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetAgentCollaborator", "Required field: AgentId, is not set"); return GetAgentCollaboratorOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -1224,37 +817,22 @@ GetAgentCollaboratorOutcome BedrockAgentClient::GetAgentCollaborator(const GetAg return GetAgentCollaboratorOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [CollaboratorId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetAgentCollaborator, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetAgentCollaborator, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetAgentCollaborator", - {{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( - [&]() -> GetAgentCollaboratorOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); - resolvedEndpoint.AddPathSegments("/agentcollaborators/"); - resolvedEndpoint.AddPathSegment(request.GetCollaboratorId()); - }); - return result.IsSuccess() ? GetAgentCollaboratorOutcome(result.GetResultWithOwnership()) - : GetAgentCollaboratorOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); + resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); + resolvedEndpoint.AddPathSegments("/agentcollaborators/"); + resolvedEndpoint.AddPathSegment(request.GetCollaboratorId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetAgentCollaboratorOutcome(result.GetResultWithOwnership()) + : GetAgentCollaboratorOutcome(std::move(result.GetError())); } - GetAgentKnowledgeBaseOutcome BedrockAgentClient::GetAgentKnowledgeBase(const GetAgentKnowledgeBaseRequest& request) const { - AWS_OPERATION_GUARD(GetAgentKnowledgeBase); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetAgentKnowledgeBase, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetAgentKnowledgeBase", "Required field: AgentId, is not set"); return GetAgentKnowledgeBaseOutcome(Aws::Client::AWSError( @@ -1270,37 +848,22 @@ GetAgentKnowledgeBaseOutcome BedrockAgentClient::GetAgentKnowledgeBase(const Get return GetAgentKnowledgeBaseOutcome(Aws::Client::AWSError( BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [KnowledgeBaseId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetAgentKnowledgeBase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetAgentKnowledgeBase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetAgentKnowledgeBase", - {{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( - [&]() -> GetAgentKnowledgeBaseOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - }); - return result.IsSuccess() ? GetAgentKnowledgeBaseOutcome(result.GetResultWithOwnership()) - : GetAgentKnowledgeBaseOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); + resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetAgentKnowledgeBaseOutcome(result.GetResultWithOwnership()) + : GetAgentKnowledgeBaseOutcome(std::move(result.GetError())); } - GetAgentVersionOutcome BedrockAgentClient::GetAgentVersion(const GetAgentVersionRequest& request) const { - AWS_OPERATION_GUARD(GetAgentVersion); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetAgentVersion, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetAgentVersion", "Required field: AgentId, is not set"); return GetAgentVersionOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -1311,35 +874,20 @@ GetAgentVersionOutcome BedrockAgentClient::GetAgentVersion(const GetAgentVersion return GetAgentVersionOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentVersion]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetAgentVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetAgentVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetAgentVersion", - {{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( - [&]() -> GetAgentVersionOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); - }); - return result.IsSuccess() ? GetAgentVersionOutcome(result.GetResultWithOwnership()) - : GetAgentVersionOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); + resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetAgentVersionOutcome(result.GetResultWithOwnership()) + : GetAgentVersionOutcome(std::move(result.GetError())); } - GetDataSourceOutcome BedrockAgentClient::GetDataSource(const GetDataSourceRequest& request) const { - AWS_OPERATION_GUARD(GetDataSource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetDataSource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.KnowledgeBaseIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetDataSource", "Required field: KnowledgeBaseId, is not set"); return GetDataSourceOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -1350,66 +898,35 @@ GetDataSourceOutcome BedrockAgentClient::GetDataSource(const GetDataSourceReques return GetDataSourceOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [DataSourceId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetDataSource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetDataSource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetDataSource", - {{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( - [&]() -> GetDataSourceOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - resolvedEndpoint.AddPathSegments("/datasources/"); - resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); - }); - return result.IsSuccess() ? GetDataSourceOutcome(result.GetResultWithOwnership()) - : GetDataSourceOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); + resolvedEndpoint.AddPathSegments("/datasources/"); + resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetDataSourceOutcome(result.GetResultWithOwnership()) : GetDataSourceOutcome(std::move(result.GetError())); } - GetFlowOutcome BedrockAgentClient::GetFlow(const GetFlowRequest& request) const { - AWS_OPERATION_GUARD(GetFlow); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetFlow, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.FlowIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetFlow", "Required field: FlowIdentifier, is not set"); return GetFlowOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [FlowIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetFlow, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetFlow, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetFlow", - {{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( - [&]() -> GetFlowOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - }); - return result.IsSuccess() ? GetFlowOutcome(result.GetResultWithOwnership()) : GetFlowOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetFlowOutcome(result.GetResultWithOwnership()) : GetFlowOutcome(std::move(result.GetError())); } - GetFlowAliasOutcome BedrockAgentClient::GetFlowAlias(const GetFlowAliasRequest& request) const { - AWS_OPERATION_GUARD(GetFlowAlias); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetFlowAlias, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.FlowIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetFlowAlias", "Required field: FlowIdentifier, is not set"); return GetFlowAliasOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -1420,35 +937,19 @@ GetFlowAliasOutcome BedrockAgentClient::GetFlowAlias(const GetFlowAliasRequest& return GetFlowAliasOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AliasIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetFlowAlias, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetFlowAlias, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetFlowAlias", - {{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( - [&]() -> GetFlowAliasOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - resolvedEndpoint.AddPathSegments("/aliases/"); - resolvedEndpoint.AddPathSegment(request.GetAliasIdentifier()); - }); - return result.IsSuccess() ? GetFlowAliasOutcome(result.GetResultWithOwnership()) - : GetFlowAliasOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); + resolvedEndpoint.AddPathSegments("/aliases/"); + resolvedEndpoint.AddPathSegment(request.GetAliasIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetFlowAliasOutcome(result.GetResultWithOwnership()) : GetFlowAliasOutcome(std::move(result.GetError())); } - GetFlowVersionOutcome BedrockAgentClient::GetFlowVersion(const GetFlowVersionRequest& request) const { - AWS_OPERATION_GUARD(GetFlowVersion); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetFlowVersion, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.FlowIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetFlowVersion", "Required field: FlowIdentifier, is not set"); return GetFlowVersionOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -1459,35 +960,19 @@ GetFlowVersionOutcome BedrockAgentClient::GetFlowVersion(const GetFlowVersionReq return GetFlowVersionOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [FlowVersion]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetFlowVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetFlowVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetFlowVersion", - {{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( - [&]() -> GetFlowVersionOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - resolvedEndpoint.AddPathSegments("/versions/"); - resolvedEndpoint.AddPathSegment(request.GetFlowVersion()); - }); - return result.IsSuccess() ? GetFlowVersionOutcome(result.GetResultWithOwnership()) - : GetFlowVersionOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); + resolvedEndpoint.AddPathSegments("/versions/"); + resolvedEndpoint.AddPathSegment(request.GetFlowVersion()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetFlowVersionOutcome(result.GetResultWithOwnership()) : GetFlowVersionOutcome(std::move(result.GetError())); } - GetIngestionJobOutcome BedrockAgentClient::GetIngestionJob(const GetIngestionJobRequest& request) const { - AWS_OPERATION_GUARD(GetIngestionJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetIngestionJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.KnowledgeBaseIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetIngestionJob", "Required field: KnowledgeBaseId, is not set"); return GetIngestionJobOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -1503,69 +988,39 @@ GetIngestionJobOutcome BedrockAgentClient::GetIngestionJob(const GetIngestionJob return GetIngestionJobOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [IngestionJobId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetIngestionJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetIngestionJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetIngestionJob", - {{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( - [&]() -> GetIngestionJobOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - resolvedEndpoint.AddPathSegments("/datasources/"); - resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); - resolvedEndpoint.AddPathSegments("/ingestionjobs/"); - resolvedEndpoint.AddPathSegment(request.GetIngestionJobId()); - }); - return result.IsSuccess() ? GetIngestionJobOutcome(result.GetResultWithOwnership()) - : GetIngestionJobOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); + resolvedEndpoint.AddPathSegments("/datasources/"); + resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); + resolvedEndpoint.AddPathSegments("/ingestionjobs/"); + resolvedEndpoint.AddPathSegment(request.GetIngestionJobId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetIngestionJobOutcome(result.GetResultWithOwnership()) + : GetIngestionJobOutcome(std::move(result.GetError())); } - GetKnowledgeBaseOutcome BedrockAgentClient::GetKnowledgeBase(const GetKnowledgeBaseRequest& request) const { - AWS_OPERATION_GUARD(GetKnowledgeBase); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetKnowledgeBase, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.KnowledgeBaseIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetKnowledgeBase", "Required field: KnowledgeBaseId, is not set"); return GetKnowledgeBaseOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [KnowledgeBaseId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetKnowledgeBase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetKnowledgeBase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetKnowledgeBase", - {{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( - [&]() -> GetKnowledgeBaseOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - }); - return result.IsSuccess() ? GetKnowledgeBaseOutcome(result.GetResultWithOwnership()) - : GetKnowledgeBaseOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetKnowledgeBaseOutcome(result.GetResultWithOwnership()) + : GetKnowledgeBaseOutcome(std::move(result.GetError())); } - GetKnowledgeBaseDocumentsOutcome BedrockAgentClient::GetKnowledgeBaseDocuments(const GetKnowledgeBaseDocumentsRequest& request) const { - AWS_OPERATION_GUARD(GetKnowledgeBaseDocuments); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetKnowledgeBaseDocuments, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.KnowledgeBaseIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetKnowledgeBaseDocuments", "Required field: KnowledgeBaseId, is not set"); return GetKnowledgeBaseDocumentsOutcome(Aws::Client::AWSError( @@ -1576,68 +1031,38 @@ GetKnowledgeBaseDocumentsOutcome BedrockAgentClient::GetKnowledgeBaseDocuments(c return GetKnowledgeBaseDocumentsOutcome(Aws::Client::AWSError( BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [DataSourceId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetKnowledgeBaseDocuments, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetKnowledgeBaseDocuments, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetKnowledgeBaseDocuments", - {{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( - [&]() -> GetKnowledgeBaseDocumentsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - resolvedEndpoint.AddPathSegments("/datasources/"); - resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); - resolvedEndpoint.AddPathSegments("/documents/getDocuments"); - }); - return result.IsSuccess() ? GetKnowledgeBaseDocumentsOutcome(result.GetResultWithOwnership()) - : GetKnowledgeBaseDocumentsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); + resolvedEndpoint.AddPathSegments("/datasources/"); + resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); + resolvedEndpoint.AddPathSegments("/documents/getDocuments"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GetKnowledgeBaseDocumentsOutcome(result.GetResultWithOwnership()) + : GetKnowledgeBaseDocumentsOutcome(std::move(result.GetError())); } - GetPromptOutcome BedrockAgentClient::GetPrompt(const GetPromptRequest& request) const { - AWS_OPERATION_GUARD(GetPrompt); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetPrompt, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PromptIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetPrompt", "Required field: PromptIdentifier, is not set"); return GetPromptOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [PromptIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetPrompt, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetPrompt, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetPrompt", - {{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( - [&]() -> GetPromptOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/prompts/"); - resolvedEndpoint.AddPathSegment(request.GetPromptIdentifier()); - }); - return result.IsSuccess() ? GetPromptOutcome(result.GetResultWithOwnership()) : GetPromptOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/prompts/"); + resolvedEndpoint.AddPathSegment(request.GetPromptIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetPromptOutcome(result.GetResultWithOwnership()) : GetPromptOutcome(std::move(result.GetError())); } - IngestKnowledgeBaseDocumentsOutcome BedrockAgentClient::IngestKnowledgeBaseDocuments( const IngestKnowledgeBaseDocumentsRequest& request) const { - AWS_OPERATION_GUARD(IngestKnowledgeBaseDocuments); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, IngestKnowledgeBaseDocuments, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.KnowledgeBaseIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("IngestKnowledgeBaseDocuments", "Required field: KnowledgeBaseId, is not set"); return IngestKnowledgeBaseDocumentsOutcome(Aws::Client::AWSError( @@ -1648,36 +1073,21 @@ IngestKnowledgeBaseDocumentsOutcome BedrockAgentClient::IngestKnowledgeBaseDocum return IngestKnowledgeBaseDocumentsOutcome(Aws::Client::AWSError( BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [DataSourceId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, IngestKnowledgeBaseDocuments, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, IngestKnowledgeBaseDocuments, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".IngestKnowledgeBaseDocuments", - {{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( - [&]() -> IngestKnowledgeBaseDocumentsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - resolvedEndpoint.AddPathSegments("/datasources/"); - resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); - resolvedEndpoint.AddPathSegments("/documents"); - }); - return result.IsSuccess() ? IngestKnowledgeBaseDocumentsOutcome(result.GetResultWithOwnership()) - : IngestKnowledgeBaseDocumentsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); + resolvedEndpoint.AddPathSegments("/datasources/"); + resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); + resolvedEndpoint.AddPathSegments("/documents"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? IngestKnowledgeBaseDocumentsOutcome(result.GetResultWithOwnership()) + : IngestKnowledgeBaseDocumentsOutcome(std::move(result.GetError())); } - ListAgentActionGroupsOutcome BedrockAgentClient::ListAgentActionGroups(const ListAgentActionGroupsRequest& request) const { - AWS_OPERATION_GUARD(ListAgentActionGroups); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListAgentActionGroups, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListAgentActionGroups", "Required field: AgentId, is not set"); return ListAgentActionGroupsOutcome(Aws::Client::AWSError( @@ -1688,69 +1098,39 @@ ListAgentActionGroupsOutcome BedrockAgentClient::ListAgentActionGroups(const Lis return ListAgentActionGroupsOutcome(Aws::Client::AWSError( BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentVersion]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListAgentActionGroups, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListAgentActionGroups, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListAgentActionGroups", - {{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( - [&]() -> ListAgentActionGroupsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); - resolvedEndpoint.AddPathSegments("/actiongroups/"); - }); - return result.IsSuccess() ? ListAgentActionGroupsOutcome(result.GetResultWithOwnership()) - : ListAgentActionGroupsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); + resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); + resolvedEndpoint.AddPathSegments("/actiongroups/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListAgentActionGroupsOutcome(result.GetResultWithOwnership()) + : ListAgentActionGroupsOutcome(std::move(result.GetError())); } - ListAgentAliasesOutcome BedrockAgentClient::ListAgentAliases(const ListAgentAliasesRequest& request) const { - AWS_OPERATION_GUARD(ListAgentAliases); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListAgentAliases, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListAgentAliases", "Required field: AgentId, is not set"); return ListAgentAliasesOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListAgentAliases, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListAgentAliases, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListAgentAliases", - {{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( - [&]() -> ListAgentAliasesOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentaliases/"); - }); - return result.IsSuccess() ? ListAgentAliasesOutcome(result.GetResultWithOwnership()) - : ListAgentAliasesOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentaliases/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListAgentAliasesOutcome(result.GetResultWithOwnership()) + : ListAgentAliasesOutcome(std::move(result.GetError())); } - ListAgentCollaboratorsOutcome BedrockAgentClient::ListAgentCollaborators(const ListAgentCollaboratorsRequest& request) const { - AWS_OPERATION_GUARD(ListAgentCollaborators); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListAgentCollaborators, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListAgentCollaborators", "Required field: AgentId, is not set"); return ListAgentCollaboratorsOutcome(Aws::Client::AWSError( @@ -1761,36 +1141,21 @@ ListAgentCollaboratorsOutcome BedrockAgentClient::ListAgentCollaborators(const L return ListAgentCollaboratorsOutcome(Aws::Client::AWSError( BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentVersion]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListAgentCollaborators, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListAgentCollaborators, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListAgentCollaborators", - {{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( - [&]() -> ListAgentCollaboratorsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); - resolvedEndpoint.AddPathSegments("/agentcollaborators/"); - }); - return result.IsSuccess() ? ListAgentCollaboratorsOutcome(result.GetResultWithOwnership()) - : ListAgentCollaboratorsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); + resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); + resolvedEndpoint.AddPathSegments("/agentcollaborators/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListAgentCollaboratorsOutcome(result.GetResultWithOwnership()) + : ListAgentCollaboratorsOutcome(std::move(result.GetError())); } - ListAgentKnowledgeBasesOutcome BedrockAgentClient::ListAgentKnowledgeBases(const ListAgentKnowledgeBasesRequest& request) const { - AWS_OPERATION_GUARD(ListAgentKnowledgeBases); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListAgentKnowledgeBases, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListAgentKnowledgeBases", "Required field: AgentId, is not set"); return ListAgentKnowledgeBasesOutcome(Aws::Client::AWSError( @@ -1801,216 +1166,105 @@ ListAgentKnowledgeBasesOutcome BedrockAgentClient::ListAgentKnowledgeBases(const return ListAgentKnowledgeBasesOutcome(Aws::Client::AWSError( BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentVersion]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListAgentKnowledgeBases, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListAgentKnowledgeBases, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListAgentKnowledgeBases", - {{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( - [&]() -> ListAgentKnowledgeBasesOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - }); - return result.IsSuccess() ? ListAgentKnowledgeBasesOutcome(result.GetResultWithOwnership()) - : ListAgentKnowledgeBasesOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); + resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); + resolvedEndpoint.AddPathSegments("/knowledgebases/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListAgentKnowledgeBasesOutcome(result.GetResultWithOwnership()) + : ListAgentKnowledgeBasesOutcome(std::move(result.GetError())); } - ListAgentVersionsOutcome BedrockAgentClient::ListAgentVersions(const ListAgentVersionsRequest& request) const { - AWS_OPERATION_GUARD(ListAgentVersions); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListAgentVersions, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListAgentVersions", "Required field: AgentId, is not set"); return ListAgentVersionsOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListAgentVersions, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListAgentVersions, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListAgentVersions", - {{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( - [&]() -> ListAgentVersionsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - }); - return result.IsSuccess() ? ListAgentVersionsOutcome(result.GetResultWithOwnership()) - : ListAgentVersionsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListAgentVersionsOutcome(result.GetResultWithOwnership()) + : ListAgentVersionsOutcome(std::move(result.GetError())); } - ListAgentsOutcome BedrockAgentClient::ListAgents(const ListAgentsRequest& request) const { - AWS_OPERATION_GUARD(ListAgents); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListAgents, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListAgents, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListAgents, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListAgents", - {{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( - [&]() -> ListAgentsOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/agents/"); }); - return result.IsSuccess() ? ListAgentsOutcome(result.GetResultWithOwnership()) : ListAgentsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/agents/"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListAgentsOutcome(result.GetResultWithOwnership()) : ListAgentsOutcome(std::move(result.GetError())); } - ListDataSourcesOutcome BedrockAgentClient::ListDataSources(const ListDataSourcesRequest& request) const { - AWS_OPERATION_GUARD(ListDataSources); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListDataSources, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.KnowledgeBaseIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListDataSources", "Required field: KnowledgeBaseId, is not set"); return ListDataSourcesOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [KnowledgeBaseId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListDataSources, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListDataSources, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListDataSources", - {{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( - [&]() -> ListDataSourcesOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - resolvedEndpoint.AddPathSegments("/datasources/"); - }); - return result.IsSuccess() ? ListDataSourcesOutcome(result.GetResultWithOwnership()) - : ListDataSourcesOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); + resolvedEndpoint.AddPathSegments("/datasources/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListDataSourcesOutcome(result.GetResultWithOwnership()) + : ListDataSourcesOutcome(std::move(result.GetError())); } - ListFlowAliasesOutcome BedrockAgentClient::ListFlowAliases(const ListFlowAliasesRequest& request) const { - AWS_OPERATION_GUARD(ListFlowAliases); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListFlowAliases, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.FlowIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListFlowAliases", "Required field: FlowIdentifier, is not set"); return ListFlowAliasesOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [FlowIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListFlowAliases, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListFlowAliases, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListFlowAliases", - {{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( - [&]() -> ListFlowAliasesOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - resolvedEndpoint.AddPathSegments("/aliases"); - }); - return result.IsSuccess() ? ListFlowAliasesOutcome(result.GetResultWithOwnership()) - : ListFlowAliasesOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); + resolvedEndpoint.AddPathSegments("/aliases"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListFlowAliasesOutcome(result.GetResultWithOwnership()) + : ListFlowAliasesOutcome(std::move(result.GetError())); } - ListFlowVersionsOutcome BedrockAgentClient::ListFlowVersions(const ListFlowVersionsRequest& request) const { - AWS_OPERATION_GUARD(ListFlowVersions); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListFlowVersions, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.FlowIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListFlowVersions", "Required field: FlowIdentifier, is not set"); return ListFlowVersionsOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [FlowIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListFlowVersions, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListFlowVersions, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListFlowVersions", - {{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( - [&]() -> ListFlowVersionsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - resolvedEndpoint.AddPathSegments("/versions"); - }); - return result.IsSuccess() ? ListFlowVersionsOutcome(result.GetResultWithOwnership()) - : ListFlowVersionsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); + resolvedEndpoint.AddPathSegments("/versions"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListFlowVersionsOutcome(result.GetResultWithOwnership()) + : ListFlowVersionsOutcome(std::move(result.GetError())); } - ListFlowsOutcome BedrockAgentClient::ListFlows(const ListFlowsRequest& request) const { - AWS_OPERATION_GUARD(ListFlows); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListFlows, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListFlows, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListFlows, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListFlows", - {{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( - [&]() -> ListFlowsOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/flows/"); }); - return result.IsSuccess() ? ListFlowsOutcome(result.GetResultWithOwnership()) : ListFlowsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/flows/"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListFlowsOutcome(result.GetResultWithOwnership()) : ListFlowsOutcome(std::move(result.GetError())); } - ListIngestionJobsOutcome BedrockAgentClient::ListIngestionJobs(const ListIngestionJobsRequest& request) const { - AWS_OPERATION_GUARD(ListIngestionJobs); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListIngestionJobs, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.KnowledgeBaseIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListIngestionJobs", "Required field: KnowledgeBaseId, is not set"); return ListIngestionJobsOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -2021,36 +1275,21 @@ ListIngestionJobsOutcome BedrockAgentClient::ListIngestionJobs(const ListIngesti return ListIngestionJobsOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [DataSourceId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListIngestionJobs, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListIngestionJobs, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListIngestionJobs", - {{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( - [&]() -> ListIngestionJobsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - resolvedEndpoint.AddPathSegments("/datasources/"); - resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); - resolvedEndpoint.AddPathSegments("/ingestionjobs/"); - }); - return result.IsSuccess() ? ListIngestionJobsOutcome(result.GetResultWithOwnership()) - : ListIngestionJobsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); + resolvedEndpoint.AddPathSegments("/datasources/"); + resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); + resolvedEndpoint.AddPathSegments("/ingestionjobs/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListIngestionJobsOutcome(result.GetResultWithOwnership()) + : ListIngestionJobsOutcome(std::move(result.GetError())); } - ListKnowledgeBaseDocumentsOutcome BedrockAgentClient::ListKnowledgeBaseDocuments(const ListKnowledgeBaseDocumentsRequest& request) const { - AWS_OPERATION_GUARD(ListKnowledgeBaseDocuments); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListKnowledgeBaseDocuments, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.KnowledgeBaseIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListKnowledgeBaseDocuments", "Required field: KnowledgeBaseId, is not set"); return ListKnowledgeBaseDocumentsOutcome(Aws::Client::AWSError( @@ -2061,180 +1300,83 @@ ListKnowledgeBaseDocumentsOutcome BedrockAgentClient::ListKnowledgeBaseDocuments return ListKnowledgeBaseDocumentsOutcome(Aws::Client::AWSError( BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [DataSourceId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListKnowledgeBaseDocuments, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListKnowledgeBaseDocuments, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListKnowledgeBaseDocuments", - {{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( - [&]() -> ListKnowledgeBaseDocumentsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - resolvedEndpoint.AddPathSegments("/datasources/"); - resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); - resolvedEndpoint.AddPathSegments("/documents"); - }); - return result.IsSuccess() ? ListKnowledgeBaseDocumentsOutcome(result.GetResultWithOwnership()) - : ListKnowledgeBaseDocumentsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); + resolvedEndpoint.AddPathSegments("/datasources/"); + resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); + resolvedEndpoint.AddPathSegments("/documents"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListKnowledgeBaseDocumentsOutcome(result.GetResultWithOwnership()) + : ListKnowledgeBaseDocumentsOutcome(std::move(result.GetError())); } - ListKnowledgeBasesOutcome BedrockAgentClient::ListKnowledgeBases(const ListKnowledgeBasesRequest& request) const { - AWS_OPERATION_GUARD(ListKnowledgeBases); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListKnowledgeBases, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListKnowledgeBases, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListKnowledgeBases, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListKnowledgeBases", - {{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( - [&]() -> ListKnowledgeBasesOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/knowledgebases/"); }); - return result.IsSuccess() ? ListKnowledgeBasesOutcome(result.GetResultWithOwnership()) - : ListKnowledgeBasesOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/knowledgebases/"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListKnowledgeBasesOutcome(result.GetResultWithOwnership()) + : ListKnowledgeBasesOutcome(std::move(result.GetError())); } - ListPromptsOutcome BedrockAgentClient::ListPrompts(const ListPromptsRequest& request) const { - AWS_OPERATION_GUARD(ListPrompts); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListPrompts, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListPrompts, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListPrompts, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListPrompts", - {{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( - [&]() -> ListPromptsOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/prompts/"); }); - return result.IsSuccess() ? ListPromptsOutcome(result.GetResultWithOwnership()) : ListPromptsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/prompts/"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListPromptsOutcome(result.GetResultWithOwnership()) : ListPromptsOutcome(std::move(result.GetError())); } - ListTagsForResourceOutcome BedrockAgentClient::ListTagsForResource(const ListTagsForResourceRequest& request) const { - AWS_OPERATION_GUARD(ListTagsForResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListTagsForResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ResourceArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListTagsForResource", "Required field: ResourceArn, is not set"); return ListTagsForResourceOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ResourceArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListTagsForResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListTagsForResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListTagsForResource", - {{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( - [&]() -> ListTagsForResourceOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/tags/"); - resolvedEndpoint.AddPathSegment(request.GetResourceArn()); - }); - return result.IsSuccess() ? ListTagsForResourceOutcome(result.GetResultWithOwnership()) - : ListTagsForResourceOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/tags/"); + resolvedEndpoint.AddPathSegment(request.GetResourceArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListTagsForResourceOutcome(result.GetResultWithOwnership()) + : ListTagsForResourceOutcome(std::move(result.GetError())); } - PrepareAgentOutcome BedrockAgentClient::PrepareAgent(const PrepareAgentRequest& request) const { - AWS_OPERATION_GUARD(PrepareAgent); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, PrepareAgent, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("PrepareAgent", "Required field: AgentId, is not set"); return PrepareAgentOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, PrepareAgent, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, PrepareAgent, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".PrepareAgent", - {{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( - [&]() -> PrepareAgentOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - }); - return result.IsSuccess() ? PrepareAgentOutcome(result.GetResultWithOwnership()) - : PrepareAgentOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? PrepareAgentOutcome(result.GetResultWithOwnership()) : PrepareAgentOutcome(std::move(result.GetError())); } - PrepareFlowOutcome BedrockAgentClient::PrepareFlow(const PrepareFlowRequest& request) const { - AWS_OPERATION_GUARD(PrepareFlow); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, PrepareFlow, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.FlowIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("PrepareFlow", "Required field: FlowIdentifier, is not set"); return PrepareFlowOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [FlowIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, PrepareFlow, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, PrepareFlow, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".PrepareFlow", - {{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( - [&]() -> PrepareFlowOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - }); - return result.IsSuccess() ? PrepareFlowOutcome(result.GetResultWithOwnership()) : PrepareFlowOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? PrepareFlowOutcome(result.GetResultWithOwnership()) : PrepareFlowOutcome(std::move(result.GetError())); } - StartIngestionJobOutcome BedrockAgentClient::StartIngestionJob(const StartIngestionJobRequest& request) const { - AWS_OPERATION_GUARD(StartIngestionJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, StartIngestionJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.KnowledgeBaseIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("StartIngestionJob", "Required field: KnowledgeBaseId, is not set"); return StartIngestionJobOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -2245,36 +1387,21 @@ StartIngestionJobOutcome BedrockAgentClient::StartIngestionJob(const StartIngest return StartIngestionJobOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [DataSourceId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, StartIngestionJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, StartIngestionJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".StartIngestionJob", - {{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( - [&]() -> StartIngestionJobOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - resolvedEndpoint.AddPathSegments("/datasources/"); - resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); - resolvedEndpoint.AddPathSegments("/ingestionjobs/"); - }); - return result.IsSuccess() ? StartIngestionJobOutcome(result.GetResultWithOwnership()) - : StartIngestionJobOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); + resolvedEndpoint.AddPathSegments("/datasources/"); + resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); + resolvedEndpoint.AddPathSegments("/ingestionjobs/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? StartIngestionJobOutcome(result.GetResultWithOwnership()) + : StartIngestionJobOutcome(std::move(result.GetError())); } - StopIngestionJobOutcome BedrockAgentClient::StopIngestionJob(const StopIngestionJobRequest& request) const { - AWS_OPERATION_GUARD(StopIngestionJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, StopIngestionJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.KnowledgeBaseIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("StopIngestionJob", "Required field: KnowledgeBaseId, is not set"); return StopIngestionJobOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -2290,69 +1417,39 @@ StopIngestionJobOutcome BedrockAgentClient::StopIngestionJob(const StopIngestion return StopIngestionJobOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [IngestionJobId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, StopIngestionJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, StopIngestionJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".StopIngestionJob", - {{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( - [&]() -> StopIngestionJobOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - resolvedEndpoint.AddPathSegments("/datasources/"); - resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); - resolvedEndpoint.AddPathSegments("/ingestionjobs/"); - resolvedEndpoint.AddPathSegment(request.GetIngestionJobId()); - resolvedEndpoint.AddPathSegments("/stop"); - }); - return result.IsSuccess() ? StopIngestionJobOutcome(result.GetResultWithOwnership()) - : StopIngestionJobOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); + resolvedEndpoint.AddPathSegments("/datasources/"); + resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); + resolvedEndpoint.AddPathSegments("/ingestionjobs/"); + resolvedEndpoint.AddPathSegment(request.GetIngestionJobId()); + resolvedEndpoint.AddPathSegments("/stop"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? StopIngestionJobOutcome(result.GetResultWithOwnership()) + : StopIngestionJobOutcome(std::move(result.GetError())); } - TagResourceOutcome BedrockAgentClient::TagResource(const TagResourceRequest& request) const { - AWS_OPERATION_GUARD(TagResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, TagResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ResourceArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("TagResource", "Required field: ResourceArn, is not set"); return TagResourceOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ResourceArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, TagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, TagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".TagResource", - {{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( - [&]() -> TagResourceOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/tags/"); - resolvedEndpoint.AddPathSegment(request.GetResourceArn()); - }); - return result.IsSuccess() ? TagResourceOutcome(result.GetResultWithOwnership()) : TagResourceOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/tags/"); + resolvedEndpoint.AddPathSegment(request.GetResourceArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? TagResourceOutcome(result.GetResultWithOwnership()) : TagResourceOutcome(std::move(result.GetError())); } - UntagResourceOutcome BedrockAgentClient::UntagResource(const UntagResourceRequest& request) const { - AWS_OPERATION_GUARD(UntagResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UntagResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ResourceArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("UntagResource", "Required field: ResourceArn, is not set"); return UntagResourceOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -2363,64 +1460,33 @@ UntagResourceOutcome BedrockAgentClient::UntagResource(const UntagResourceReques return UntagResourceOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [TagKeys]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UntagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UntagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UntagResource", - {{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( - [&]() -> UntagResourceOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/tags/"); - resolvedEndpoint.AddPathSegment(request.GetResourceArn()); - }); - return result.IsSuccess() ? UntagResourceOutcome(result.GetResultWithOwnership()) - : UntagResourceOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/tags/"); + resolvedEndpoint.AddPathSegment(request.GetResourceArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? UntagResourceOutcome(result.GetResultWithOwnership()) : UntagResourceOutcome(std::move(result.GetError())); } - UpdateAgentOutcome BedrockAgentClient::UpdateAgent(const UpdateAgentRequest& request) const { - AWS_OPERATION_GUARD(UpdateAgent); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateAgent, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateAgent", "Required field: AgentId, is not set"); return UpdateAgentOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateAgent, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateAgent, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateAgent", - {{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( - [&]() -> UpdateAgentOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - }); - return result.IsSuccess() ? UpdateAgentOutcome(result.GetResultWithOwnership()) : UpdateAgentOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? UpdateAgentOutcome(result.GetResultWithOwnership()) : UpdateAgentOutcome(std::move(result.GetError())); } - UpdateAgentActionGroupOutcome BedrockAgentClient::UpdateAgentActionGroup(const UpdateAgentActionGroupRequest& request) const { - AWS_OPERATION_GUARD(UpdateAgentActionGroup); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateAgentActionGroup, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateAgentActionGroup", "Required field: AgentId, is not set"); return UpdateAgentActionGroupOutcome(Aws::Client::AWSError( @@ -2436,37 +1502,22 @@ UpdateAgentActionGroupOutcome BedrockAgentClient::UpdateAgentActionGroup(const U return UpdateAgentActionGroupOutcome(Aws::Client::AWSError( BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ActionGroupId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateAgentActionGroup, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateAgentActionGroup, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateAgentActionGroup", - {{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( - [&]() -> UpdateAgentActionGroupOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); - resolvedEndpoint.AddPathSegments("/actiongroups/"); - resolvedEndpoint.AddPathSegment(request.GetActionGroupId()); - }); - return result.IsSuccess() ? UpdateAgentActionGroupOutcome(result.GetResultWithOwnership()) - : UpdateAgentActionGroupOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); + resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); + resolvedEndpoint.AddPathSegments("/actiongroups/"); + resolvedEndpoint.AddPathSegment(request.GetActionGroupId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? UpdateAgentActionGroupOutcome(result.GetResultWithOwnership()) + : UpdateAgentActionGroupOutcome(std::move(result.GetError())); } - UpdateAgentAliasOutcome BedrockAgentClient::UpdateAgentAlias(const UpdateAgentAliasRequest& request) const { - AWS_OPERATION_GUARD(UpdateAgentAlias); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateAgentAlias, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateAgentAlias", "Required field: AgentId, is not set"); return UpdateAgentAliasOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -2477,35 +1528,20 @@ UpdateAgentAliasOutcome BedrockAgentClient::UpdateAgentAlias(const UpdateAgentAl return UpdateAgentAliasOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AgentAliasId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateAgentAlias, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateAgentAlias, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateAgentAlias", - {{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( - [&]() -> UpdateAgentAliasOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentaliases/"); - resolvedEndpoint.AddPathSegment(request.GetAgentAliasId()); - }); - return result.IsSuccess() ? UpdateAgentAliasOutcome(result.GetResultWithOwnership()) - : UpdateAgentAliasOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentaliases/"); + resolvedEndpoint.AddPathSegment(request.GetAgentAliasId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? UpdateAgentAliasOutcome(result.GetResultWithOwnership()) + : UpdateAgentAliasOutcome(std::move(result.GetError())); } - UpdateAgentCollaboratorOutcome BedrockAgentClient::UpdateAgentCollaborator(const UpdateAgentCollaboratorRequest& request) const { - AWS_OPERATION_GUARD(UpdateAgentCollaborator); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateAgentCollaborator, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateAgentCollaborator", "Required field: AgentId, is not set"); return UpdateAgentCollaboratorOutcome(Aws::Client::AWSError( @@ -2521,37 +1557,22 @@ UpdateAgentCollaboratorOutcome BedrockAgentClient::UpdateAgentCollaborator(const return UpdateAgentCollaboratorOutcome(Aws::Client::AWSError( BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [CollaboratorId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateAgentCollaborator, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateAgentCollaborator, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateAgentCollaborator", - {{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( - [&]() -> UpdateAgentCollaboratorOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); - resolvedEndpoint.AddPathSegments("/agentcollaborators/"); - resolvedEndpoint.AddPathSegment(request.GetCollaboratorId()); - }); - return result.IsSuccess() ? UpdateAgentCollaboratorOutcome(result.GetResultWithOwnership()) - : UpdateAgentCollaboratorOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); + resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); + resolvedEndpoint.AddPathSegments("/agentcollaborators/"); + resolvedEndpoint.AddPathSegment(request.GetCollaboratorId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? UpdateAgentCollaboratorOutcome(result.GetResultWithOwnership()) + : UpdateAgentCollaboratorOutcome(std::move(result.GetError())); } - UpdateAgentKnowledgeBaseOutcome BedrockAgentClient::UpdateAgentKnowledgeBase(const UpdateAgentKnowledgeBaseRequest& request) const { - AWS_OPERATION_GUARD(UpdateAgentKnowledgeBase); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateAgentKnowledgeBase, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.AgentIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateAgentKnowledgeBase", "Required field: AgentId, is not set"); return UpdateAgentKnowledgeBaseOutcome(Aws::Client::AWSError( @@ -2567,37 +1588,22 @@ UpdateAgentKnowledgeBaseOutcome BedrockAgentClient::UpdateAgentKnowledgeBase(con return UpdateAgentKnowledgeBaseOutcome(Aws::Client::AWSError( BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [KnowledgeBaseId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateAgentKnowledgeBase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateAgentKnowledgeBase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateAgentKnowledgeBase", - {{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( - [&]() -> UpdateAgentKnowledgeBaseOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/agents/"); - resolvedEndpoint.AddPathSegment(request.GetAgentId()); - resolvedEndpoint.AddPathSegments("/agentversions/"); - resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - }); - return result.IsSuccess() ? UpdateAgentKnowledgeBaseOutcome(result.GetResultWithOwnership()) - : UpdateAgentKnowledgeBaseOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/agents/"); + resolvedEndpoint.AddPathSegment(request.GetAgentId()); + resolvedEndpoint.AddPathSegments("/agentversions/"); + resolvedEndpoint.AddPathSegment(request.GetAgentVersion()); + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? UpdateAgentKnowledgeBaseOutcome(result.GetResultWithOwnership()) + : UpdateAgentKnowledgeBaseOutcome(std::move(result.GetError())); } - UpdateDataSourceOutcome BedrockAgentClient::UpdateDataSource(const UpdateDataSourceRequest& request) const { - AWS_OPERATION_GUARD(UpdateDataSource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateDataSource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.KnowledgeBaseIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateDataSource", "Required field: KnowledgeBaseId, is not set"); return UpdateDataSourceOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -2608,66 +1614,36 @@ UpdateDataSourceOutcome BedrockAgentClient::UpdateDataSource(const UpdateDataSou return UpdateDataSourceOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [DataSourceId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateDataSource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateDataSource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateDataSource", - {{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( - [&]() -> UpdateDataSourceOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - resolvedEndpoint.AddPathSegments("/datasources/"); - resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); - }); - return result.IsSuccess() ? UpdateDataSourceOutcome(result.GetResultWithOwnership()) - : UpdateDataSourceOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); + resolvedEndpoint.AddPathSegments("/datasources/"); + resolvedEndpoint.AddPathSegment(request.GetDataSourceId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? UpdateDataSourceOutcome(result.GetResultWithOwnership()) + : UpdateDataSourceOutcome(std::move(result.GetError())); } - UpdateFlowOutcome BedrockAgentClient::UpdateFlow(const UpdateFlowRequest& request) const { - AWS_OPERATION_GUARD(UpdateFlow); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateFlow, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.FlowIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateFlow", "Required field: FlowIdentifier, is not set"); return UpdateFlowOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [FlowIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateFlow, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateFlow, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateFlow", - {{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( - [&]() -> UpdateFlowOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - }); - return result.IsSuccess() ? UpdateFlowOutcome(result.GetResultWithOwnership()) : UpdateFlowOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? UpdateFlowOutcome(result.GetResultWithOwnership()) : UpdateFlowOutcome(std::move(result.GetError())); } - UpdateFlowAliasOutcome BedrockAgentClient::UpdateFlowAlias(const UpdateFlowAliasRequest& request) const { - AWS_OPERATION_GUARD(UpdateFlowAlias); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateFlowAlias, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.FlowIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateFlowAlias", "Required field: FlowIdentifier, is not set"); return UpdateFlowAliasOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -2678,117 +1654,56 @@ UpdateFlowAliasOutcome BedrockAgentClient::UpdateFlowAlias(const UpdateFlowAlias return UpdateFlowAliasOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AliasIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateFlowAlias, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateFlowAlias, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateFlowAlias", - {{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( - [&]() -> UpdateFlowAliasOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/flows/"); - resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); - resolvedEndpoint.AddPathSegments("/aliases/"); - resolvedEndpoint.AddPathSegment(request.GetAliasIdentifier()); - }); - return result.IsSuccess() ? UpdateFlowAliasOutcome(result.GetResultWithOwnership()) - : UpdateFlowAliasOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/flows/"); + resolvedEndpoint.AddPathSegment(request.GetFlowIdentifier()); + resolvedEndpoint.AddPathSegments("/aliases/"); + resolvedEndpoint.AddPathSegment(request.GetAliasIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? UpdateFlowAliasOutcome(result.GetResultWithOwnership()) + : UpdateFlowAliasOutcome(std::move(result.GetError())); } - UpdateKnowledgeBaseOutcome BedrockAgentClient::UpdateKnowledgeBase(const UpdateKnowledgeBaseRequest& request) const { - AWS_OPERATION_GUARD(UpdateKnowledgeBase); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateKnowledgeBase, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.KnowledgeBaseIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateKnowledgeBase", "Required field: KnowledgeBaseId, is not set"); return UpdateKnowledgeBaseOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [KnowledgeBaseId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateKnowledgeBase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateKnowledgeBase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateKnowledgeBase", - {{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( - [&]() -> UpdateKnowledgeBaseOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/knowledgebases/"); - resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); - }); - return result.IsSuccess() ? UpdateKnowledgeBaseOutcome(result.GetResultWithOwnership()) - : UpdateKnowledgeBaseOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/knowledgebases/"); + resolvedEndpoint.AddPathSegment(request.GetKnowledgeBaseId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? UpdateKnowledgeBaseOutcome(result.GetResultWithOwnership()) + : UpdateKnowledgeBaseOutcome(std::move(result.GetError())); } - UpdatePromptOutcome BedrockAgentClient::UpdatePrompt(const UpdatePromptRequest& request) const { - AWS_OPERATION_GUARD(UpdatePrompt); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdatePrompt, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PromptIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdatePrompt", "Required field: PromptIdentifier, is not set"); return UpdatePromptOutcome(Aws::Client::AWSError(BedrockAgentErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [PromptIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdatePrompt, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdatePrompt, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdatePrompt", - {{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( - [&]() -> UpdatePromptOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/prompts/"); - resolvedEndpoint.AddPathSegment(request.GetPromptIdentifier()); - }); - return result.IsSuccess() ? UpdatePromptOutcome(result.GetResultWithOwnership()) - : UpdatePromptOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/prompts/"); + resolvedEndpoint.AddPathSegment(request.GetPromptIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? UpdatePromptOutcome(result.GetResultWithOwnership()) : UpdatePromptOutcome(std::move(result.GetError())); } - ValidateFlowDefinitionOutcome BedrockAgentClient::ValidateFlowDefinition(const ValidateFlowDefinitionRequest& request) const { - AWS_OPERATION_GUARD(ValidateFlowDefinition); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ValidateFlowDefinition, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ValidateFlowDefinition, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ValidateFlowDefinition, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ValidateFlowDefinition", - {{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( - [&]() -> ValidateFlowDefinitionOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/flows/validate-definition"); }); - return result.IsSuccess() ? ValidateFlowDefinitionOutcome(result.GetResultWithOwnership()) - : ValidateFlowDefinitionOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/flows/validate-definition"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ValidateFlowDefinitionOutcome(result.GetResultWithOwnership()) + : ValidateFlowDefinitionOutcome(std::move(result.GetError())); } diff --git a/generated/src/aws-cpp-sdk-bedrock-data-automation-runtime/include/aws/bedrock-data-automation-runtime/BedrockDataAutomationRuntimeClient.h b/generated/src/aws-cpp-sdk-bedrock-data-automation-runtime/include/aws/bedrock-data-automation-runtime/BedrockDataAutomationRuntimeClient.h index d4eede6f2d1f..594e8bfd4e90 100644 --- a/generated/src/aws-cpp-sdk-bedrock-data-automation-runtime/include/aws/bedrock-data-automation-runtime/BedrockDataAutomationRuntimeClient.h +++ b/generated/src/aws-cpp-sdk-bedrock-data-automation-runtime/include/aws/bedrock-data-automation-runtime/BedrockDataAutomationRuntimeClient.h @@ -256,6 +256,11 @@ class AWS_BEDROCKDATAAUTOMATIONRUNTIME_API BedrockDataAutomationRuntimeClient private: friend class Aws::Client::ClientWithAsyncTemplateMethods; + + typedef Aws::Utils::Outcome, BedrockDataAutomationRuntimeError> + InvokeOperationOutcome; + + InvokeOperationOutcome InvokeServiceOperation(const AmazonWebServiceRequest& request, Aws::Http::HttpMethod httpMethod) const; }; } // namespace BedrockDataAutomationRuntime diff --git a/generated/src/aws-cpp-sdk-bedrock-data-automation-runtime/source/BedrockDataAutomationRuntimeClient.cpp b/generated/src/aws-cpp-sdk-bedrock-data-automation-runtime/source/BedrockDataAutomationRuntimeClient.cpp index fb97da283df6..80a915c9381f 100644 --- a/generated/src/aws-cpp-sdk-bedrock-data-automation-runtime/source/BedrockDataAutomationRuntimeClient.cpp +++ b/generated/src/aws-cpp-sdk-bedrock-data-automation-runtime/source/BedrockDataAutomationRuntimeClient.cpp @@ -146,153 +146,63 @@ void BedrockDataAutomationRuntimeClient::OverrideEndpoint(const Aws::String& end m_clientConfiguration.endpointOverride = endpoint; m_endpointProvider->OverrideEndpoint(endpoint); } -GetDataAutomationStatusOutcome BedrockDataAutomationRuntimeClient::GetDataAutomationStatus( - const GetDataAutomationStatusRequest& request) const { - AWS_OPERATION_GUARD(GetDataAutomationStatus); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetDataAutomationStatus, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetDataAutomationStatus, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetDataAutomationStatus, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetDataAutomationStatus", - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}, +BedrockDataAutomationRuntimeClient::InvokeOperationOutcome BedrockDataAutomationRuntimeClient::InvokeServiceOperation( + const AmazonWebServiceRequest& request, Aws::Http::HttpMethod httpMethod) const { + auto operationName = request.GetServiceRequestName(); + auto serviceName = GetServiceClientName(); + + AWS_OPERATION_GUARD_DYNAMIC(operationName); + + AWS_OPERATION_CHECK_PTR_DYNAMIC(m_clientConfiguration.telemetryProvider, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto tracer = m_clientConfiguration.telemetryProvider->getTracer(serviceName, {}); + auto meter = m_clientConfiguration.telemetryProvider->getMeter(serviceName, {}); + AWS_OPERATION_CHECK_PTR_DYNAMIC(meter, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto span = tracer->CreateSpan(Aws::String(serviceName) + "." + operationName, + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, + {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}, {TracingUtils::SMITHY_SYSTEM_DIMENSION, TracingUtils::SMITHY_METHOD_AWS_VALUE}}, smithy::components::tracing::SpanKind::CLIENT); - return TracingUtils::MakeCallWithTiming( - [&]() -> GetDataAutomationStatusOutcome { + + return TracingUtils::MakeCallWithTiming( + [&]() -> InvokeOperationOutcome { auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, + MakeRequestDeserialize(&request, operationName, httpMethod, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? GetDataAutomationStatusOutcome(result.GetResultWithOwnership()) - : GetDataAutomationStatusOutcome(std::move(result.GetError())); + return result.IsSuccess() ? InvokeOperationOutcome(result.GetResultWithOwnership()) + : InvokeOperationOutcome(std::move(result.GetError())); }, TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}}); +} +GetDataAutomationStatusOutcome BedrockDataAutomationRuntimeClient::GetDataAutomationStatus( + const GetDataAutomationStatusRequest& request) const { + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GetDataAutomationStatusOutcome(result.GetResultWithOwnership()) + : GetDataAutomationStatusOutcome(std::move(result.GetError())); } - InvokeDataAutomationOutcome BedrockDataAutomationRuntimeClient::InvokeDataAutomation(const InvokeDataAutomationRequest& request) const { - AWS_OPERATION_GUARD(InvokeDataAutomation); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, InvokeDataAutomation, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, InvokeDataAutomation, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, InvokeDataAutomation, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".InvokeDataAutomation", - {{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( - [&]() -> InvokeDataAutomationOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? InvokeDataAutomationOutcome(result.GetResultWithOwnership()) - : InvokeDataAutomationOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? InvokeDataAutomationOutcome(result.GetResultWithOwnership()) + : InvokeDataAutomationOutcome(std::move(result.GetError())); } - InvokeDataAutomationAsyncOutcome BedrockDataAutomationRuntimeClient::InvokeDataAutomationAsync( const InvokeDataAutomationAsyncRequest& request) const { - AWS_OPERATION_GUARD(InvokeDataAutomationAsync); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, InvokeDataAutomationAsync, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, InvokeDataAutomationAsync, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, InvokeDataAutomationAsync, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".InvokeDataAutomationAsync", - {{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( - [&]() -> InvokeDataAutomationAsyncOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? InvokeDataAutomationAsyncOutcome(result.GetResultWithOwnership()) - : InvokeDataAutomationAsyncOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? InvokeDataAutomationAsyncOutcome(result.GetResultWithOwnership()) + : InvokeDataAutomationAsyncOutcome(std::move(result.GetError())); } - ListTagsForResourceOutcome BedrockDataAutomationRuntimeClient::ListTagsForResource(const ListTagsForResourceRequest& request) const { - AWS_OPERATION_GUARD(ListTagsForResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListTagsForResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListTagsForResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListTagsForResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListTagsForResource", - {{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( - [&]() -> ListTagsForResourceOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? ListTagsForResourceOutcome(result.GetResultWithOwnership()) - : ListTagsForResourceOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListTagsForResourceOutcome(result.GetResultWithOwnership()) + : ListTagsForResourceOutcome(std::move(result.GetError())); } - TagResourceOutcome BedrockDataAutomationRuntimeClient::TagResource(const TagResourceRequest& request) const { - AWS_OPERATION_GUARD(TagResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, TagResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, TagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, TagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".TagResource", - {{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( - [&]() -> TagResourceOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? TagResourceOutcome(result.GetResultWithOwnership()) : TagResourceOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? TagResourceOutcome(result.GetResultWithOwnership()) : TagResourceOutcome(std::move(result.GetError())); } - UntagResourceOutcome BedrockDataAutomationRuntimeClient::UntagResource(const UntagResourceRequest& request) const { - AWS_OPERATION_GUARD(UntagResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UntagResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UntagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UntagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UntagResource", - {{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( - [&]() -> UntagResourceOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? UntagResourceOutcome(result.GetResultWithOwnership()) - : UntagResourceOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? UntagResourceOutcome(result.GetResultWithOwnership()) : UntagResourceOutcome(std::move(result.GetError())); } diff --git a/generated/src/aws-cpp-sdk-bedrock-data-automation/include/aws/bedrock-data-automation/BedrockDataAutomationClient.h b/generated/src/aws-cpp-sdk-bedrock-data-automation/include/aws/bedrock-data-automation/BedrockDataAutomationClient.h index 728ca27d5294..82dad5de1c00 100644 --- a/generated/src/aws-cpp-sdk-bedrock-data-automation/include/aws/bedrock-data-automation/BedrockDataAutomationClient.h +++ b/generated/src/aws-cpp-sdk-bedrock-data-automation/include/aws/bedrock-data-automation/BedrockDataAutomationClient.h @@ -859,6 +859,12 @@ class AWS_BEDROCKDATAAUTOMATION_API BedrockDataAutomationClient private: friend class Aws::Client::ClientWithAsyncTemplateMethods; + + typedef Aws::Utils::Outcome, BedrockDataAutomationError> InvokeOperationOutcome; + + InvokeOperationOutcome InvokeServiceOperation(const AmazonWebServiceRequest& request, + const std::function& resolveUri, + Aws::Http::HttpMethod httpMethod) const; }; } // namespace BedrockDataAutomation diff --git a/generated/src/aws-cpp-sdk-bedrock-data-automation/source/BedrockDataAutomationClient.cpp b/generated/src/aws-cpp-sdk-bedrock-data-automation/source/BedrockDataAutomationClient.cpp index aee14b4ead25..abde70ddae3d 100644 --- a/generated/src/aws-cpp-sdk-bedrock-data-automation/source/BedrockDataAutomationClient.cpp +++ b/generated/src/aws-cpp-sdk-bedrock-data-automation/source/BedrockDataAutomationClient.cpp @@ -167,349 +167,202 @@ void BedrockDataAutomationClient::OverrideEndpoint(const Aws::String& endpoint) m_clientConfiguration.endpointOverride = endpoint; m_endpointProvider->OverrideEndpoint(endpoint); } +BedrockDataAutomationClient::InvokeOperationOutcome BedrockDataAutomationClient::InvokeServiceOperation( + const AmazonWebServiceRequest& request, const std::function& resolveUri, + Aws::Http::HttpMethod httpMethod) const { + auto operationName = request.GetServiceRequestName(); + auto serviceName = GetServiceClientName(); + + AWS_OPERATION_GUARD_DYNAMIC(operationName); + + AWS_OPERATION_CHECK_PTR_DYNAMIC(m_clientConfiguration.telemetryProvider, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto tracer = m_clientConfiguration.telemetryProvider->getTracer(serviceName, {}); + auto meter = m_clientConfiguration.telemetryProvider->getMeter(serviceName, {}); + AWS_OPERATION_CHECK_PTR_DYNAMIC(meter, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto span = tracer->CreateSpan(Aws::String(serviceName) + "." + operationName, + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, + {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}, + {TracingUtils::SMITHY_SYSTEM_DIMENSION, TracingUtils::SMITHY_METHOD_AWS_VALUE}}, + smithy::components::tracing::SpanKind::CLIENT); + + return TracingUtils::MakeCallWithTiming( + [&]() -> InvokeOperationOutcome { + auto result = MakeRequestDeserialize(&request, operationName, httpMethod, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolveUri(resolvedEndpoint); }); + return result.IsSuccess() ? InvokeOperationOutcome(result.GetResultWithOwnership()) + : InvokeOperationOutcome(std::move(result.GetError())); + }, + TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}}); +} CopyBlueprintStageOutcome BedrockDataAutomationClient::CopyBlueprintStage(const CopyBlueprintStageRequest& request) const { - AWS_OPERATION_GUARD(CopyBlueprintStage); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CopyBlueprintStage, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.BlueprintArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("CopyBlueprintStage", "Required field: BlueprintArn, is not set"); return CopyBlueprintStageOutcome(Aws::Client::AWSError( BedrockDataAutomationErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [BlueprintArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CopyBlueprintStage, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CopyBlueprintStage, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CopyBlueprintStage", - {{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( - [&]() -> CopyBlueprintStageOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/blueprints/"); - resolvedEndpoint.AddPathSegment(request.GetBlueprintArn()); - resolvedEndpoint.AddPathSegments("/copy-stage"); - }); - return result.IsSuccess() ? CopyBlueprintStageOutcome(result.GetResultWithOwnership()) - : CopyBlueprintStageOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/blueprints/"); + resolvedEndpoint.AddPathSegment(request.GetBlueprintArn()); + resolvedEndpoint.AddPathSegments("/copy-stage"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? CopyBlueprintStageOutcome(result.GetResultWithOwnership()) + : CopyBlueprintStageOutcome(std::move(result.GetError())); } - CreateBlueprintOutcome BedrockDataAutomationClient::CreateBlueprint(const CreateBlueprintRequest& request) const { - AWS_OPERATION_GUARD(CreateBlueprint); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateBlueprint, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateBlueprint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateBlueprint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateBlueprint", - {{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( - [&]() -> CreateBlueprintOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/blueprints/"); }); - return result.IsSuccess() ? CreateBlueprintOutcome(result.GetResultWithOwnership()) - : CreateBlueprintOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/blueprints/"); }, + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? CreateBlueprintOutcome(result.GetResultWithOwnership()) + : CreateBlueprintOutcome(std::move(result.GetError())); } - CreateBlueprintVersionOutcome BedrockDataAutomationClient::CreateBlueprintVersion(const CreateBlueprintVersionRequest& request) const { - AWS_OPERATION_GUARD(CreateBlueprintVersion); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateBlueprintVersion, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.BlueprintArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("CreateBlueprintVersion", "Required field: BlueprintArn, is not set"); return CreateBlueprintVersionOutcome(Aws::Client::AWSError( BedrockDataAutomationErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [BlueprintArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateBlueprintVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateBlueprintVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateBlueprintVersion", - {{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( - [&]() -> CreateBlueprintVersionOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/blueprints/"); - resolvedEndpoint.AddPathSegment(request.GetBlueprintArn()); - resolvedEndpoint.AddPathSegments("/versions/"); - }); - return result.IsSuccess() ? CreateBlueprintVersionOutcome(result.GetResultWithOwnership()) - : CreateBlueprintVersionOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/blueprints/"); + resolvedEndpoint.AddPathSegment(request.GetBlueprintArn()); + resolvedEndpoint.AddPathSegments("/versions/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateBlueprintVersionOutcome(result.GetResultWithOwnership()) + : CreateBlueprintVersionOutcome(std::move(result.GetError())); } - CreateDataAutomationLibraryOutcome BedrockDataAutomationClient::CreateDataAutomationLibrary( const CreateDataAutomationLibraryRequest& request) const { - AWS_OPERATION_GUARD(CreateDataAutomationLibrary); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateDataAutomationLibrary, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateDataAutomationLibrary, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateDataAutomationLibrary, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateDataAutomationLibrary", - {{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( - [&]() -> CreateDataAutomationLibraryOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); }); - return result.IsSuccess() ? CreateDataAutomationLibraryOutcome(result.GetResultWithOwnership()) - : CreateDataAutomationLibraryOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); }, + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? CreateDataAutomationLibraryOutcome(result.GetResultWithOwnership()) + : CreateDataAutomationLibraryOutcome(std::move(result.GetError())); } - CreateDataAutomationProjectOutcome BedrockDataAutomationClient::CreateDataAutomationProject( const CreateDataAutomationProjectRequest& request) const { - AWS_OPERATION_GUARD(CreateDataAutomationProject); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateDataAutomationProject, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateDataAutomationProject, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateDataAutomationProject, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateDataAutomationProject", - {{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( - [&]() -> CreateDataAutomationProjectOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/data-automation-projects/"); }); - return result.IsSuccess() ? CreateDataAutomationProjectOutcome(result.GetResultWithOwnership()) - : CreateDataAutomationProjectOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/data-automation-projects/"); }, + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? CreateDataAutomationProjectOutcome(result.GetResultWithOwnership()) + : CreateDataAutomationProjectOutcome(std::move(result.GetError())); } - DeleteBlueprintOutcome BedrockDataAutomationClient::DeleteBlueprint(const DeleteBlueprintRequest& request) const { - AWS_OPERATION_GUARD(DeleteBlueprint); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteBlueprint, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.BlueprintArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteBlueprint", "Required field: BlueprintArn, is not set"); return DeleteBlueprintOutcome(Aws::Client::AWSError( BedrockDataAutomationErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [BlueprintArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteBlueprint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteBlueprint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteBlueprint", - {{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( - [&]() -> DeleteBlueprintOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/blueprints/"); - resolvedEndpoint.AddPathSegment(request.GetBlueprintArn()); - }); - return result.IsSuccess() ? DeleteBlueprintOutcome(result.GetResultWithOwnership()) - : DeleteBlueprintOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/blueprints/"); + resolvedEndpoint.AddPathSegment(request.GetBlueprintArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteBlueprintOutcome(result.GetResultWithOwnership()) + : DeleteBlueprintOutcome(std::move(result.GetError())); } - DeleteDataAutomationLibraryOutcome BedrockDataAutomationClient::DeleteDataAutomationLibrary( const DeleteDataAutomationLibraryRequest& request) const { - AWS_OPERATION_GUARD(DeleteDataAutomationLibrary); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteDataAutomationLibrary, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.LibraryArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteDataAutomationLibrary", "Required field: LibraryArn, is not set"); return DeleteDataAutomationLibraryOutcome(Aws::Client::AWSError( BedrockDataAutomationErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [LibraryArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteDataAutomationLibrary, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteDataAutomationLibrary, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteDataAutomationLibrary", - {{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( - [&]() -> DeleteDataAutomationLibraryOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); - resolvedEndpoint.AddPathSegment(request.GetLibraryArn()); - }); - return result.IsSuccess() ? DeleteDataAutomationLibraryOutcome(result.GetResultWithOwnership()) - : DeleteDataAutomationLibraryOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); + resolvedEndpoint.AddPathSegment(request.GetLibraryArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteDataAutomationLibraryOutcome(result.GetResultWithOwnership()) + : DeleteDataAutomationLibraryOutcome(std::move(result.GetError())); } - DeleteDataAutomationProjectOutcome BedrockDataAutomationClient::DeleteDataAutomationProject( const DeleteDataAutomationProjectRequest& request) const { - AWS_OPERATION_GUARD(DeleteDataAutomationProject); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteDataAutomationProject, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ProjectArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteDataAutomationProject", "Required field: ProjectArn, is not set"); return DeleteDataAutomationProjectOutcome(Aws::Client::AWSError( BedrockDataAutomationErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ProjectArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteDataAutomationProject, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteDataAutomationProject, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteDataAutomationProject", - {{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( - [&]() -> DeleteDataAutomationProjectOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/data-automation-projects/"); - resolvedEndpoint.AddPathSegment(request.GetProjectArn()); - }); - return result.IsSuccess() ? DeleteDataAutomationProjectOutcome(result.GetResultWithOwnership()) - : DeleteDataAutomationProjectOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/data-automation-projects/"); + resolvedEndpoint.AddPathSegment(request.GetProjectArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteDataAutomationProjectOutcome(result.GetResultWithOwnership()) + : DeleteDataAutomationProjectOutcome(std::move(result.GetError())); } - GetBlueprintOutcome BedrockDataAutomationClient::GetBlueprint(const GetBlueprintRequest& request) const { - AWS_OPERATION_GUARD(GetBlueprint); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetBlueprint, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.BlueprintArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetBlueprint", "Required field: BlueprintArn, is not set"); return GetBlueprintOutcome(Aws::Client::AWSError( BedrockDataAutomationErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [BlueprintArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetBlueprint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetBlueprint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetBlueprint", - {{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( - [&]() -> GetBlueprintOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/blueprints/"); - resolvedEndpoint.AddPathSegment(request.GetBlueprintArn()); - }); - return result.IsSuccess() ? GetBlueprintOutcome(result.GetResultWithOwnership()) - : GetBlueprintOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/blueprints/"); + resolvedEndpoint.AddPathSegment(request.GetBlueprintArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GetBlueprintOutcome(result.GetResultWithOwnership()) : GetBlueprintOutcome(std::move(result.GetError())); } - GetBlueprintOptimizationStatusOutcome BedrockDataAutomationClient::GetBlueprintOptimizationStatus( const GetBlueprintOptimizationStatusRequest& request) const { - AWS_OPERATION_GUARD(GetBlueprintOptimizationStatus); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetBlueprintOptimizationStatus, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.InvocationArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetBlueprintOptimizationStatus", "Required field: InvocationArn, is not set"); return GetBlueprintOptimizationStatusOutcome(Aws::Client::AWSError( BedrockDataAutomationErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [InvocationArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetBlueprintOptimizationStatus, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetBlueprintOptimizationStatus, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetBlueprintOptimizationStatus", - {{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( - [&]() -> GetBlueprintOptimizationStatusOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/getBlueprintOptimizationStatus/"); - resolvedEndpoint.AddPathSegment(request.GetInvocationArn()); - }); - return result.IsSuccess() ? GetBlueprintOptimizationStatusOutcome(result.GetResultWithOwnership()) - : GetBlueprintOptimizationStatusOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/getBlueprintOptimizationStatus/"); + resolvedEndpoint.AddPathSegment(request.GetInvocationArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GetBlueprintOptimizationStatusOutcome(result.GetResultWithOwnership()) + : GetBlueprintOptimizationStatusOutcome(std::move(result.GetError())); } - GetDataAutomationLibraryOutcome BedrockDataAutomationClient::GetDataAutomationLibrary( const GetDataAutomationLibraryRequest& request) const { - AWS_OPERATION_GUARD(GetDataAutomationLibrary); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetDataAutomationLibrary, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.LibraryArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetDataAutomationLibrary", "Required field: LibraryArn, is not set"); return GetDataAutomationLibraryOutcome(Aws::Client::AWSError( BedrockDataAutomationErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [LibraryArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetDataAutomationLibrary, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetDataAutomationLibrary, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetDataAutomationLibrary", - {{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( - [&]() -> GetDataAutomationLibraryOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); - resolvedEndpoint.AddPathSegment(request.GetLibraryArn()); - }); - return result.IsSuccess() ? GetDataAutomationLibraryOutcome(result.GetResultWithOwnership()) - : GetDataAutomationLibraryOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); + resolvedEndpoint.AddPathSegment(request.GetLibraryArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GetDataAutomationLibraryOutcome(result.GetResultWithOwnership()) + : GetDataAutomationLibraryOutcome(std::move(result.GetError())); } - GetDataAutomationLibraryEntityOutcome BedrockDataAutomationClient::GetDataAutomationLibraryEntity( const GetDataAutomationLibraryEntityRequest& request) const { - AWS_OPERATION_GUARD(GetDataAutomationLibraryEntity); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetDataAutomationLibraryEntity, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.LibraryArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetDataAutomationLibraryEntity", "Required field: LibraryArn, is not set"); return GetDataAutomationLibraryEntityOutcome(Aws::Client::AWSError( @@ -525,39 +378,23 @@ GetDataAutomationLibraryEntityOutcome BedrockDataAutomationClient::GetDataAutoma return GetDataAutomationLibraryEntityOutcome(Aws::Client::AWSError( BedrockDataAutomationErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [EntityId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetDataAutomationLibraryEntity, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetDataAutomationLibraryEntity, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetDataAutomationLibraryEntity", - {{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( - [&]() -> GetDataAutomationLibraryEntityOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); - resolvedEndpoint.AddPathSegment(request.GetLibraryArn()); - resolvedEndpoint.AddPathSegments("/entityType/"); - resolvedEndpoint.AddPathSegment(EntityTypeMapper::GetNameForEntityType(request.GetEntityType())); - resolvedEndpoint.AddPathSegments("/entities/"); - resolvedEndpoint.AddPathSegment(request.GetEntityId()); - }); - return result.IsSuccess() ? GetDataAutomationLibraryEntityOutcome(result.GetResultWithOwnership()) - : GetDataAutomationLibraryEntityOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); + resolvedEndpoint.AddPathSegment(request.GetLibraryArn()); + resolvedEndpoint.AddPathSegments("/entityType/"); + resolvedEndpoint.AddPathSegment(EntityTypeMapper::GetNameForEntityType(request.GetEntityType())); + resolvedEndpoint.AddPathSegments("/entities/"); + resolvedEndpoint.AddPathSegment(request.GetEntityId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GetDataAutomationLibraryEntityOutcome(result.GetResultWithOwnership()) + : GetDataAutomationLibraryEntityOutcome(std::move(result.GetError())); } - GetDataAutomationLibraryIngestionJobOutcome BedrockDataAutomationClient::GetDataAutomationLibraryIngestionJob( const GetDataAutomationLibraryIngestionJobRequest& request) const { - AWS_OPERATION_GUARD(GetDataAutomationLibraryIngestionJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetDataAutomationLibraryIngestionJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.LibraryArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetDataAutomationLibraryIngestionJob", "Required field: LibraryArn, is not set"); return GetDataAutomationLibraryIngestionJobOutcome(Aws::Client::AWSError( @@ -568,184 +405,80 @@ GetDataAutomationLibraryIngestionJobOutcome BedrockDataAutomationClient::GetData return GetDataAutomationLibraryIngestionJobOutcome(Aws::Client::AWSError( BedrockDataAutomationErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [JobArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetDataAutomationLibraryIngestionJob, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetDataAutomationLibraryIngestionJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetDataAutomationLibraryIngestionJob", - {{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( - [&]() -> GetDataAutomationLibraryIngestionJobOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); - resolvedEndpoint.AddPathSegment(request.GetLibraryArn()); - resolvedEndpoint.AddPathSegments("/library-ingestion-jobs/"); - resolvedEndpoint.AddPathSegment(request.GetJobArn()); - }); - return result.IsSuccess() ? GetDataAutomationLibraryIngestionJobOutcome(result.GetResultWithOwnership()) - : GetDataAutomationLibraryIngestionJobOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); + resolvedEndpoint.AddPathSegment(request.GetLibraryArn()); + resolvedEndpoint.AddPathSegments("/library-ingestion-jobs/"); + resolvedEndpoint.AddPathSegment(request.GetJobArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GetDataAutomationLibraryIngestionJobOutcome(result.GetResultWithOwnership()) + : GetDataAutomationLibraryIngestionJobOutcome(std::move(result.GetError())); } - GetDataAutomationProjectOutcome BedrockDataAutomationClient::GetDataAutomationProject( const GetDataAutomationProjectRequest& request) const { - AWS_OPERATION_GUARD(GetDataAutomationProject); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetDataAutomationProject, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ProjectArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetDataAutomationProject", "Required field: ProjectArn, is not set"); return GetDataAutomationProjectOutcome(Aws::Client::AWSError( BedrockDataAutomationErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ProjectArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetDataAutomationProject, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetDataAutomationProject, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetDataAutomationProject", - {{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( - [&]() -> GetDataAutomationProjectOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/data-automation-projects/"); - resolvedEndpoint.AddPathSegment(request.GetProjectArn()); - }); - return result.IsSuccess() ? GetDataAutomationProjectOutcome(result.GetResultWithOwnership()) - : GetDataAutomationProjectOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/data-automation-projects/"); + resolvedEndpoint.AddPathSegment(request.GetProjectArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GetDataAutomationProjectOutcome(result.GetResultWithOwnership()) + : GetDataAutomationProjectOutcome(std::move(result.GetError())); } - InvokeBlueprintOptimizationAsyncOutcome BedrockDataAutomationClient::InvokeBlueprintOptimizationAsync( const InvokeBlueprintOptimizationAsyncRequest& request) const { - AWS_OPERATION_GUARD(InvokeBlueprintOptimizationAsync); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, InvokeBlueprintOptimizationAsync, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, InvokeBlueprintOptimizationAsync, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, InvokeBlueprintOptimizationAsync, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".InvokeBlueprintOptimizationAsync", - {{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( - [&]() -> InvokeBlueprintOptimizationAsyncOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/invokeBlueprintOptimizationAsync"); - }); - return result.IsSuccess() ? InvokeBlueprintOptimizationAsyncOutcome(result.GetResultWithOwnership()) - : InvokeBlueprintOptimizationAsyncOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/invokeBlueprintOptimizationAsync"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? InvokeBlueprintOptimizationAsyncOutcome(result.GetResultWithOwnership()) + : InvokeBlueprintOptimizationAsyncOutcome(std::move(result.GetError())); } - InvokeDataAutomationLibraryIngestionJobOutcome BedrockDataAutomationClient::InvokeDataAutomationLibraryIngestionJob( const InvokeDataAutomationLibraryIngestionJobRequest& request) const { - AWS_OPERATION_GUARD(InvokeDataAutomationLibraryIngestionJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, InvokeDataAutomationLibraryIngestionJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.LibraryArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("InvokeDataAutomationLibraryIngestionJob", "Required field: LibraryArn, is not set"); return InvokeDataAutomationLibraryIngestionJobOutcome(Aws::Client::AWSError( BedrockDataAutomationErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [LibraryArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, InvokeDataAutomationLibraryIngestionJob, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, InvokeDataAutomationLibraryIngestionJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".InvokeDataAutomationLibraryIngestionJob", - {{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( - [&]() -> InvokeDataAutomationLibraryIngestionJobOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); - resolvedEndpoint.AddPathSegment(request.GetLibraryArn()); - resolvedEndpoint.AddPathSegments("/library-ingestion-jobs/"); - }); - return result.IsSuccess() ? InvokeDataAutomationLibraryIngestionJobOutcome(result.GetResultWithOwnership()) - : InvokeDataAutomationLibraryIngestionJobOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); + resolvedEndpoint.AddPathSegment(request.GetLibraryArn()); + resolvedEndpoint.AddPathSegments("/library-ingestion-jobs/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? InvokeDataAutomationLibraryIngestionJobOutcome(result.GetResultWithOwnership()) + : InvokeDataAutomationLibraryIngestionJobOutcome(std::move(result.GetError())); } - ListBlueprintsOutcome BedrockDataAutomationClient::ListBlueprints(const ListBlueprintsRequest& request) const { - AWS_OPERATION_GUARD(ListBlueprints); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListBlueprints, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListBlueprints, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListBlueprints, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListBlueprints", - {{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( - [&]() -> ListBlueprintsOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/blueprints/"); }); - return result.IsSuccess() ? ListBlueprintsOutcome(result.GetResultWithOwnership()) - : ListBlueprintsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/blueprints/"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListBlueprintsOutcome(result.GetResultWithOwnership()) : ListBlueprintsOutcome(std::move(result.GetError())); } - ListDataAutomationLibrariesOutcome BedrockDataAutomationClient::ListDataAutomationLibraries( const ListDataAutomationLibrariesRequest& request) const { - AWS_OPERATION_GUARD(ListDataAutomationLibraries); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListDataAutomationLibraries, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListDataAutomationLibraries, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListDataAutomationLibraries, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListDataAutomationLibraries", - {{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( - [&]() -> ListDataAutomationLibrariesOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); }); - return result.IsSuccess() ? ListDataAutomationLibrariesOutcome(result.GetResultWithOwnership()) - : ListDataAutomationLibrariesOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListDataAutomationLibrariesOutcome(result.GetResultWithOwnership()) + : ListDataAutomationLibrariesOutcome(std::move(result.GetError())); } - ListDataAutomationLibraryEntitiesOutcome BedrockDataAutomationClient::ListDataAutomationLibraryEntities( const ListDataAutomationLibraryEntitiesRequest& request) const { - AWS_OPERATION_GUARD(ListDataAutomationLibraryEntities); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListDataAutomationLibraryEntities, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.LibraryArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListDataAutomationLibraryEntities", "Required field: LibraryArn, is not set"); return ListDataAutomationLibraryEntitiesOutcome(Aws::Client::AWSError( @@ -756,264 +489,116 @@ ListDataAutomationLibraryEntitiesOutcome BedrockDataAutomationClient::ListDataAu return ListDataAutomationLibraryEntitiesOutcome(Aws::Client::AWSError( BedrockDataAutomationErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [EntityType]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListDataAutomationLibraryEntities, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListDataAutomationLibraryEntities, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListDataAutomationLibraryEntities", - {{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( - [&]() -> ListDataAutomationLibraryEntitiesOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); - resolvedEndpoint.AddPathSegment(request.GetLibraryArn()); - resolvedEndpoint.AddPathSegments("/entityType/"); - resolvedEndpoint.AddPathSegment(EntityTypeMapper::GetNameForEntityType(request.GetEntityType())); - resolvedEndpoint.AddPathSegments("/entities/"); - }); - return result.IsSuccess() ? ListDataAutomationLibraryEntitiesOutcome(result.GetResultWithOwnership()) - : ListDataAutomationLibraryEntitiesOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); + resolvedEndpoint.AddPathSegment(request.GetLibraryArn()); + resolvedEndpoint.AddPathSegments("/entityType/"); + resolvedEndpoint.AddPathSegment(EntityTypeMapper::GetNameForEntityType(request.GetEntityType())); + resolvedEndpoint.AddPathSegments("/entities/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListDataAutomationLibraryEntitiesOutcome(result.GetResultWithOwnership()) + : ListDataAutomationLibraryEntitiesOutcome(std::move(result.GetError())); } - ListDataAutomationLibraryIngestionJobsOutcome BedrockDataAutomationClient::ListDataAutomationLibraryIngestionJobs( const ListDataAutomationLibraryIngestionJobsRequest& request) const { - AWS_OPERATION_GUARD(ListDataAutomationLibraryIngestionJobs); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListDataAutomationLibraryIngestionJobs, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.LibraryArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListDataAutomationLibraryIngestionJobs", "Required field: LibraryArn, is not set"); return ListDataAutomationLibraryIngestionJobsOutcome(Aws::Client::AWSError( BedrockDataAutomationErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [LibraryArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListDataAutomationLibraryIngestionJobs, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListDataAutomationLibraryIngestionJobs, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListDataAutomationLibraryIngestionJobs", - {{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( - [&]() -> ListDataAutomationLibraryIngestionJobsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); - resolvedEndpoint.AddPathSegment(request.GetLibraryArn()); - resolvedEndpoint.AddPathSegments("/library-ingestion-jobs/"); - }); - return result.IsSuccess() ? ListDataAutomationLibraryIngestionJobsOutcome(result.GetResultWithOwnership()) - : ListDataAutomationLibraryIngestionJobsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); + resolvedEndpoint.AddPathSegment(request.GetLibraryArn()); + resolvedEndpoint.AddPathSegments("/library-ingestion-jobs/"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListDataAutomationLibraryIngestionJobsOutcome(result.GetResultWithOwnership()) + : ListDataAutomationLibraryIngestionJobsOutcome(std::move(result.GetError())); } - ListDataAutomationProjectsOutcome BedrockDataAutomationClient::ListDataAutomationProjects( const ListDataAutomationProjectsRequest& request) const { - AWS_OPERATION_GUARD(ListDataAutomationProjects); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListDataAutomationProjects, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListDataAutomationProjects, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListDataAutomationProjects, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListDataAutomationProjects", - {{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( - [&]() -> ListDataAutomationProjectsOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/data-automation-projects/"); }); - return result.IsSuccess() ? ListDataAutomationProjectsOutcome(result.GetResultWithOwnership()) - : ListDataAutomationProjectsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/data-automation-projects/"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListDataAutomationProjectsOutcome(result.GetResultWithOwnership()) + : ListDataAutomationProjectsOutcome(std::move(result.GetError())); } - ListTagsForResourceOutcome BedrockDataAutomationClient::ListTagsForResource(const ListTagsForResourceRequest& request) const { - AWS_OPERATION_GUARD(ListTagsForResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListTagsForResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListTagsForResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListTagsForResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListTagsForResource", - {{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( - [&]() -> ListTagsForResourceOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/listTagsForResource"); }); - return result.IsSuccess() ? ListTagsForResourceOutcome(result.GetResultWithOwnership()) - : ListTagsForResourceOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/listTagsForResource"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListTagsForResourceOutcome(result.GetResultWithOwnership()) + : ListTagsForResourceOutcome(std::move(result.GetError())); } - TagResourceOutcome BedrockDataAutomationClient::TagResource(const TagResourceRequest& request) const { - AWS_OPERATION_GUARD(TagResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, TagResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, TagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, TagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".TagResource", - {{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( - [&]() -> TagResourceOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/tagResource"); }); - return result.IsSuccess() ? TagResourceOutcome(result.GetResultWithOwnership()) : TagResourceOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/tagResource"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? TagResourceOutcome(result.GetResultWithOwnership()) : TagResourceOutcome(std::move(result.GetError())); } - UntagResourceOutcome BedrockDataAutomationClient::UntagResource(const UntagResourceRequest& request) const { - AWS_OPERATION_GUARD(UntagResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UntagResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UntagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UntagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UntagResource", - {{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( - [&]() -> UntagResourceOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/untagResource"); }); - return result.IsSuccess() ? UntagResourceOutcome(result.GetResultWithOwnership()) - : UntagResourceOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/untagResource"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? UntagResourceOutcome(result.GetResultWithOwnership()) : UntagResourceOutcome(std::move(result.GetError())); } - UpdateBlueprintOutcome BedrockDataAutomationClient::UpdateBlueprint(const UpdateBlueprintRequest& request) const { - AWS_OPERATION_GUARD(UpdateBlueprint); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateBlueprint, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.BlueprintArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateBlueprint", "Required field: BlueprintArn, is not set"); return UpdateBlueprintOutcome(Aws::Client::AWSError( BedrockDataAutomationErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [BlueprintArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateBlueprint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateBlueprint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateBlueprint", - {{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( - [&]() -> UpdateBlueprintOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/blueprints/"); - resolvedEndpoint.AddPathSegment(request.GetBlueprintArn()); - }); - return result.IsSuccess() ? UpdateBlueprintOutcome(result.GetResultWithOwnership()) - : UpdateBlueprintOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/blueprints/"); + resolvedEndpoint.AddPathSegment(request.GetBlueprintArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? UpdateBlueprintOutcome(result.GetResultWithOwnership()) + : UpdateBlueprintOutcome(std::move(result.GetError())); } - UpdateDataAutomationLibraryOutcome BedrockDataAutomationClient::UpdateDataAutomationLibrary( const UpdateDataAutomationLibraryRequest& request) const { - AWS_OPERATION_GUARD(UpdateDataAutomationLibrary); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateDataAutomationLibrary, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.LibraryArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateDataAutomationLibrary", "Required field: LibraryArn, is not set"); return UpdateDataAutomationLibraryOutcome(Aws::Client::AWSError( BedrockDataAutomationErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [LibraryArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateDataAutomationLibrary, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateDataAutomationLibrary, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateDataAutomationLibrary", - {{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( - [&]() -> UpdateDataAutomationLibraryOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); - resolvedEndpoint.AddPathSegment(request.GetLibraryArn()); - }); - return result.IsSuccess() ? UpdateDataAutomationLibraryOutcome(result.GetResultWithOwnership()) - : UpdateDataAutomationLibraryOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/data-automation-libraries/"); + resolvedEndpoint.AddPathSegment(request.GetLibraryArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? UpdateDataAutomationLibraryOutcome(result.GetResultWithOwnership()) + : UpdateDataAutomationLibraryOutcome(std::move(result.GetError())); } - UpdateDataAutomationProjectOutcome BedrockDataAutomationClient::UpdateDataAutomationProject( const UpdateDataAutomationProjectRequest& request) const { - AWS_OPERATION_GUARD(UpdateDataAutomationProject); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateDataAutomationProject, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ProjectArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateDataAutomationProject", "Required field: ProjectArn, is not set"); return UpdateDataAutomationProjectOutcome(Aws::Client::AWSError( BedrockDataAutomationErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ProjectArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateDataAutomationProject, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateDataAutomationProject, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateDataAutomationProject", - {{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( - [&]() -> UpdateDataAutomationProjectOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/data-automation-projects/"); - resolvedEndpoint.AddPathSegment(request.GetProjectArn()); - }); - return result.IsSuccess() ? UpdateDataAutomationProjectOutcome(result.GetResultWithOwnership()) - : UpdateDataAutomationProjectOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/data-automation-projects/"); + resolvedEndpoint.AddPathSegment(request.GetProjectArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? UpdateDataAutomationProjectOutcome(result.GetResultWithOwnership()) + : UpdateDataAutomationProjectOutcome(std::move(result.GetError())); } diff --git a/generated/src/aws-cpp-sdk-bedrock-runtime/include/aws/bedrock-runtime/BedrockRuntimeClient.h b/generated/src/aws-cpp-sdk-bedrock-runtime/include/aws/bedrock-runtime/BedrockRuntimeClient.h index b97252ddc927..331e128db542 100644 --- a/generated/src/aws-cpp-sdk-bedrock-runtime/include/aws/bedrock-runtime/BedrockRuntimeClient.h +++ b/generated/src/aws-cpp-sdk-bedrock-runtime/include/aws/bedrock-runtime/BedrockRuntimeClient.h @@ -525,6 +525,12 @@ class AWS_BEDROCKRUNTIME_API BedrockRuntimeClient private: friend class Aws::Client::ClientWithAsyncTemplateMethods; + + typedef Aws::Utils::Outcome, BedrockRuntimeError> InvokeOperationOutcome; + + InvokeOperationOutcome InvokeServiceOperation(const AmazonWebServiceRequest& request, + const std::function& resolveUri, + Aws::Http::HttpMethod httpMethod) const; }; } // namespace BedrockRuntime diff --git a/generated/src/aws-cpp-sdk-bedrock-runtime/source/BedrockRuntimeClient.cpp b/generated/src/aws-cpp-sdk-bedrock-runtime/source/BedrockRuntimeClient.cpp index 43292b9ecbd0..46a0495f9108 100644 --- a/generated/src/aws-cpp-sdk-bedrock-runtime/source/BedrockRuntimeClient.cpp +++ b/generated/src/aws-cpp-sdk-bedrock-runtime/source/BedrockRuntimeClient.cpp @@ -181,9 +181,37 @@ void BedrockRuntimeClient::OverrideEndpoint(const Aws::String& endpoint) { m_clientConfiguration.endpointOverride = endpoint; m_endpointProvider->OverrideEndpoint(endpoint); } +BedrockRuntimeClient::InvokeOperationOutcome BedrockRuntimeClient::InvokeServiceOperation( + const AmazonWebServiceRequest& request, const std::function& resolveUri, + Aws::Http::HttpMethod httpMethod) const { + auto operationName = request.GetServiceRequestName(); + auto serviceName = GetServiceClientName(); + + AWS_OPERATION_GUARD_DYNAMIC(operationName); + + AWS_OPERATION_CHECK_PTR_DYNAMIC(m_clientConfiguration.telemetryProvider, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto tracer = m_clientConfiguration.telemetryProvider->getTracer(serviceName, {}); + auto meter = m_clientConfiguration.telemetryProvider->getMeter(serviceName, {}); + AWS_OPERATION_CHECK_PTR_DYNAMIC(meter, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto span = tracer->CreateSpan(Aws::String(serviceName) + "." + operationName, + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, + {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}, + {TracingUtils::SMITHY_SYSTEM_DIMENSION, TracingUtils::SMITHY_METHOD_AWS_VALUE}}, + smithy::components::tracing::SpanKind::CLIENT); + + return TracingUtils::MakeCallWithTiming( + [&]() -> InvokeOperationOutcome { + auto result = MakeRequestDeserialize(&request, operationName, httpMethod, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolveUri(resolvedEndpoint); }); + return result.IsSuccess() ? InvokeOperationOutcome(result.GetResultWithOwnership()) + : InvokeOperationOutcome(std::move(result.GetError())); + }, + TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}}); +} ApplyGuardrailOutcome BedrockRuntimeClient::ApplyGuardrail(const ApplyGuardrailRequest& request) const { - AWS_OPERATION_GUARD(ApplyGuardrail); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ApplyGuardrail, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.GuardrailIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("ApplyGuardrail", "Required field: GuardrailIdentifier, is not set"); return ApplyGuardrailOutcome(Aws::Client::AWSError(BedrockRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", @@ -194,65 +222,36 @@ ApplyGuardrailOutcome BedrockRuntimeClient::ApplyGuardrail(const ApplyGuardrailR return ApplyGuardrailOutcome(Aws::Client::AWSError(BedrockRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [GuardrailVersion]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ApplyGuardrail, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ApplyGuardrail, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ApplyGuardrail", - {{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( - [&]() -> ApplyGuardrailOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/guardrail/"); - resolvedEndpoint.AddPathSegment(request.GetGuardrailIdentifier()); - resolvedEndpoint.AddPathSegments("/version/"); - resolvedEndpoint.AddPathSegment(request.GetGuardrailVersion()); - resolvedEndpoint.AddPathSegments("/apply"); - }); - return result.IsSuccess() ? ApplyGuardrailOutcome(result.GetResultWithOwnership()) - : ApplyGuardrailOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/guardrail/"); + resolvedEndpoint.AddPathSegment(request.GetGuardrailIdentifier()); + resolvedEndpoint.AddPathSegments("/version/"); + resolvedEndpoint.AddPathSegment(request.GetGuardrailVersion()); + resolvedEndpoint.AddPathSegments("/apply"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ApplyGuardrailOutcome(result.GetResultWithOwnership()) : ApplyGuardrailOutcome(std::move(result.GetError())); } - ConverseOutcome BedrockRuntimeClient::Converse(const ConverseRequest& request) const { - AWS_OPERATION_GUARD(Converse); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, Converse, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ModelIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("Converse", "Required field: ModelId, is not set"); return ConverseOutcome(Aws::Client::AWSError(BedrockRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ModelId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, Converse, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, Converse, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".Converse", - {{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( - [&]() -> ConverseOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/model/"); - resolvedEndpoint.AddPathSegment(request.GetModelId()); - resolvedEndpoint.AddPathSegments("/converse"); - }); - return result.IsSuccess() ? ConverseOutcome(result.GetResultWithOwnership()) : ConverseOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/model/"); + resolvedEndpoint.AddPathSegment(request.GetModelId()); + resolvedEndpoint.AddPathSegments("/converse"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ConverseOutcome(result.GetResultWithOwnership()) : ConverseOutcome(std::move(result.GetError())); } - ConverseStreamOutcome BedrockRuntimeClient::ConverseStream(ConverseStreamRequest& request) const { AWS_OPERATION_GUARD(ConverseStream); AWS_OPERATION_CHECK_PTR(m_endpointProvider, ConverseStream, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); @@ -297,71 +296,39 @@ ConverseStreamOutcome BedrockRuntimeClient::ConverseStream(ConverseStreamRequest {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); } - CountTokensOutcome BedrockRuntimeClient::CountTokens(const CountTokensRequest& request) const { - AWS_OPERATION_GUARD(CountTokens); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CountTokens, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ModelIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("CountTokens", "Required field: ModelId, is not set"); return CountTokensOutcome(Aws::Client::AWSError(BedrockRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ModelId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CountTokens, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CountTokens, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CountTokens", - {{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( - [&]() -> CountTokensOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/model/"); - resolvedEndpoint.AddPathSegment(request.GetModelId()); - resolvedEndpoint.AddPathSegments("/count-tokens"); - }); - return result.IsSuccess() ? CountTokensOutcome(result.GetResultWithOwnership()) : CountTokensOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/model/"); + resolvedEndpoint.AddPathSegment(request.GetModelId()); + resolvedEndpoint.AddPathSegments("/count-tokens"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CountTokensOutcome(result.GetResultWithOwnership()) : CountTokensOutcome(std::move(result.GetError())); } - GetAsyncInvokeOutcome BedrockRuntimeClient::GetAsyncInvoke(const GetAsyncInvokeRequest& request) const { - AWS_OPERATION_GUARD(GetAsyncInvoke); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetAsyncInvoke, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.InvocationArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetAsyncInvoke", "Required field: InvocationArn, is not set"); return GetAsyncInvokeOutcome(Aws::Client::AWSError(BedrockRuntimeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [InvocationArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetAsyncInvoke, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetAsyncInvoke, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetAsyncInvoke", - {{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( - [&]() -> GetAsyncInvokeOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/async-invoke/"); - resolvedEndpoint.AddPathSegment(request.GetInvocationArn()); - }); - return result.IsSuccess() ? GetAsyncInvokeOutcome(result.GetResultWithOwnership()) - : GetAsyncInvokeOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/async-invoke/"); + resolvedEndpoint.AddPathSegment(request.GetInvocationArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetAsyncInvokeOutcome(result.GetResultWithOwnership()) : GetAsyncInvokeOutcome(std::move(result.GetError())); } - InvokeModelOutcome BedrockRuntimeClient::InvokeModel(const InvokeModelRequest& request) const { AWS_OPERATION_GUARD(InvokeModel); AWS_OPERATION_CHECK_PTR(m_endpointProvider, InvokeModel, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); @@ -393,7 +360,6 @@ InvokeModelOutcome BedrockRuntimeClient::InvokeModel(const InvokeModelRequest& r {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); } - void BedrockRuntimeClient::InvokeModelWithBidirectionalStreamAsync( Model::InvokeModelWithBidirectionalStreamRequest& request, const InvokeModelWithBidirectionalStreamStreamReadyHandler& streamReadyHandler, @@ -484,53 +450,17 @@ InvokeModelWithResponseStreamOutcome BedrockRuntimeClient::InvokeModelWithRespon {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); } - ListAsyncInvokesOutcome BedrockRuntimeClient::ListAsyncInvokes(const ListAsyncInvokesRequest& request) const { - AWS_OPERATION_GUARD(ListAsyncInvokes); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListAsyncInvokes, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListAsyncInvokes, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListAsyncInvokes, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListAsyncInvokes", - {{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( - [&]() -> ListAsyncInvokesOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/async-invoke"); }); - return result.IsSuccess() ? ListAsyncInvokesOutcome(result.GetResultWithOwnership()) - : ListAsyncInvokesOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/async-invoke"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListAsyncInvokesOutcome(result.GetResultWithOwnership()) + : ListAsyncInvokesOutcome(std::move(result.GetError())); } - StartAsyncInvokeOutcome BedrockRuntimeClient::StartAsyncInvoke(const StartAsyncInvokeRequest& request) const { - AWS_OPERATION_GUARD(StartAsyncInvoke); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, StartAsyncInvoke, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, StartAsyncInvoke, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, StartAsyncInvoke, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".StartAsyncInvoke", - {{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( - [&]() -> StartAsyncInvokeOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/async-invoke"); }); - return result.IsSuccess() ? StartAsyncInvokeOutcome(result.GetResultWithOwnership()) - : StartAsyncInvokeOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/async-invoke"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? StartAsyncInvokeOutcome(result.GetResultWithOwnership()) + : StartAsyncInvokeOutcome(std::move(result.GetError())); } diff --git a/generated/src/aws-cpp-sdk-bedrock/include/aws/bedrock/BedrockClient.h b/generated/src/aws-cpp-sdk-bedrock/include/aws/bedrock/BedrockClient.h index cf056c391209..241911cb2553 100644 --- a/generated/src/aws-cpp-sdk-bedrock/include/aws/bedrock/BedrockClient.h +++ b/generated/src/aws-cpp-sdk-bedrock/include/aws/bedrock/BedrockClient.h @@ -3269,6 +3269,12 @@ class AWS_BEDROCK_API BedrockClient private: friend class Aws::Client::ClientWithAsyncTemplateMethods; + + typedef Aws::Utils::Outcome, BedrockError> InvokeOperationOutcome; + + InvokeOperationOutcome InvokeServiceOperation(const AmazonWebServiceRequest& request, + const std::function& resolveUri, + Aws::Http::HttpMethod httpMethod) const; }; } // namespace Bedrock diff --git a/generated/src/aws-cpp-sdk-bedrock/source/BedrockClient.cpp b/generated/src/aws-cpp-sdk-bedrock/source/BedrockClient.cpp index 6f753986d164..0865b24ce168 100644 --- a/generated/src/aws-cpp-sdk-bedrock/source/BedrockClient.cpp +++ b/generated/src/aws-cpp-sdk-bedrock/source/BedrockClient.cpp @@ -268,37 +268,45 @@ void BedrockClient::OverrideEndpoint(const Aws::String& endpoint) { m_clientConfiguration.endpointOverride = endpoint; m_endpointProvider->OverrideEndpoint(endpoint); } -BatchDeleteEvaluationJobOutcome BedrockClient::BatchDeleteEvaluationJob(const BatchDeleteEvaluationJobRequest& request) const { - AWS_OPERATION_GUARD(BatchDeleteEvaluationJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, BatchDeleteEvaluationJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, BatchDeleteEvaluationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, BatchDeleteEvaluationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".BatchDeleteEvaluationJob", - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}, +BedrockClient::InvokeOperationOutcome BedrockClient::InvokeServiceOperation( + const AmazonWebServiceRequest& request, const std::function& resolveUri, + Aws::Http::HttpMethod httpMethod) const { + auto operationName = request.GetServiceRequestName(); + auto serviceName = GetServiceClientName(); + + AWS_OPERATION_GUARD_DYNAMIC(operationName); + + AWS_OPERATION_CHECK_PTR_DYNAMIC(m_clientConfiguration.telemetryProvider, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto tracer = m_clientConfiguration.telemetryProvider->getTracer(serviceName, {}); + auto meter = m_clientConfiguration.telemetryProvider->getMeter(serviceName, {}); + AWS_OPERATION_CHECK_PTR_DYNAMIC(meter, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto span = tracer->CreateSpan(Aws::String(serviceName) + "." + operationName, + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, + {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}, {TracingUtils::SMITHY_SYSTEM_DIMENSION, TracingUtils::SMITHY_METHOD_AWS_VALUE}}, smithy::components::tracing::SpanKind::CLIENT); - return TracingUtils::MakeCallWithTiming( - [&]() -> BatchDeleteEvaluationJobOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/evaluation-jobs/batch-delete"); - }); - return result.IsSuccess() ? BatchDeleteEvaluationJobOutcome(result.GetResultWithOwnership()) - : BatchDeleteEvaluationJobOutcome(std::move(result.GetError())); + + return TracingUtils::MakeCallWithTiming( + [&]() -> InvokeOperationOutcome { + auto result = MakeRequestDeserialize(&request, operationName, httpMethod, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolveUri(resolvedEndpoint); }); + return result.IsSuccess() ? InvokeOperationOutcome(result.GetResultWithOwnership()) + : InvokeOperationOutcome(std::move(result.GetError())); }, TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}}); +} +BatchDeleteEvaluationJobOutcome BedrockClient::BatchDeleteEvaluationJob(const BatchDeleteEvaluationJobRequest& request) const { + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/evaluation-jobs/batch-delete"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? BatchDeleteEvaluationJobOutcome(result.GetResultWithOwnership()) + : BatchDeleteEvaluationJobOutcome(std::move(result.GetError())); } - CancelAutomatedReasoningPolicyBuildWorkflowOutcome BedrockClient::CancelAutomatedReasoningPolicyBuildWorkflow( const CancelAutomatedReasoningPolicyBuildWorkflowRequest& request) const { - AWS_OPERATION_GUARD(CancelAutomatedReasoningPolicyBuildWorkflow); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CancelAutomatedReasoningPolicyBuildWorkflow, CoreErrors, - CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("CancelAutomatedReasoningPolicyBuildWorkflow", "Required field: PolicyArn, is not set"); return CancelAutomatedReasoningPolicyBuildWorkflowOutcome(Aws::Client::AWSError( @@ -309,535 +317,202 @@ CancelAutomatedReasoningPolicyBuildWorkflowOutcome BedrockClient::CancelAutomate return CancelAutomatedReasoningPolicyBuildWorkflowOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [BuildWorkflowId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CancelAutomatedReasoningPolicyBuildWorkflow, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CancelAutomatedReasoningPolicyBuildWorkflow, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CancelAutomatedReasoningPolicyBuildWorkflow", - {{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( - [&]() -> CancelAutomatedReasoningPolicyBuildWorkflowOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/build-workflows/"); - resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); - resolvedEndpoint.AddPathSegments("/cancel"); - }); - return result.IsSuccess() ? CancelAutomatedReasoningPolicyBuildWorkflowOutcome(result.GetResultWithOwnership()) - : CancelAutomatedReasoningPolicyBuildWorkflowOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/build-workflows/"); + resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); + resolvedEndpoint.AddPathSegments("/cancel"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CancelAutomatedReasoningPolicyBuildWorkflowOutcome(result.GetResultWithOwnership()) + : CancelAutomatedReasoningPolicyBuildWorkflowOutcome(std::move(result.GetError())); } - CreateAutomatedReasoningPolicyOutcome BedrockClient::CreateAutomatedReasoningPolicy( const CreateAutomatedReasoningPolicyRequest& request) const { - AWS_OPERATION_GUARD(CreateAutomatedReasoningPolicy); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateAutomatedReasoningPolicy, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateAutomatedReasoningPolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateAutomatedReasoningPolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateAutomatedReasoningPolicy", - {{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( - [&]() -> CreateAutomatedReasoningPolicyOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies"); - }); - return result.IsSuccess() ? CreateAutomatedReasoningPolicyOutcome(result.GetResultWithOwnership()) - : CreateAutomatedReasoningPolicyOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/automated-reasoning-policies"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateAutomatedReasoningPolicyOutcome(result.GetResultWithOwnership()) + : CreateAutomatedReasoningPolicyOutcome(std::move(result.GetError())); } - CreateAutomatedReasoningPolicyTestCaseOutcome BedrockClient::CreateAutomatedReasoningPolicyTestCase( const CreateAutomatedReasoningPolicyTestCaseRequest& request) const { - AWS_OPERATION_GUARD(CreateAutomatedReasoningPolicyTestCase); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateAutomatedReasoningPolicyTestCase, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("CreateAutomatedReasoningPolicyTestCase", "Required field: PolicyArn, is not set"); return CreateAutomatedReasoningPolicyTestCaseOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [PolicyArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateAutomatedReasoningPolicyTestCase, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateAutomatedReasoningPolicyTestCase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateAutomatedReasoningPolicyTestCase", - {{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( - [&]() -> CreateAutomatedReasoningPolicyTestCaseOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/test-cases"); - }); - return result.IsSuccess() ? CreateAutomatedReasoningPolicyTestCaseOutcome(result.GetResultWithOwnership()) - : CreateAutomatedReasoningPolicyTestCaseOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/test-cases"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateAutomatedReasoningPolicyTestCaseOutcome(result.GetResultWithOwnership()) + : CreateAutomatedReasoningPolicyTestCaseOutcome(std::move(result.GetError())); } - CreateAutomatedReasoningPolicyVersionOutcome BedrockClient::CreateAutomatedReasoningPolicyVersion( const CreateAutomatedReasoningPolicyVersionRequest& request) const { - AWS_OPERATION_GUARD(CreateAutomatedReasoningPolicyVersion); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateAutomatedReasoningPolicyVersion, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("CreateAutomatedReasoningPolicyVersion", "Required field: PolicyArn, is not set"); return CreateAutomatedReasoningPolicyVersionOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [PolicyArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateAutomatedReasoningPolicyVersion, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateAutomatedReasoningPolicyVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateAutomatedReasoningPolicyVersion", - {{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( - [&]() -> CreateAutomatedReasoningPolicyVersionOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/versions"); - }); - return result.IsSuccess() ? CreateAutomatedReasoningPolicyVersionOutcome(result.GetResultWithOwnership()) - : CreateAutomatedReasoningPolicyVersionOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/versions"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateAutomatedReasoningPolicyVersionOutcome(result.GetResultWithOwnership()) + : CreateAutomatedReasoningPolicyVersionOutcome(std::move(result.GetError())); } - CreateCustomModelOutcome BedrockClient::CreateCustomModel(const CreateCustomModelRequest& request) const { - AWS_OPERATION_GUARD(CreateCustomModel); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateCustomModel, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateCustomModel, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateCustomModel, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateCustomModel", - {{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( - [&]() -> CreateCustomModelOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/custom-models/create-custom-model"); - }); - return result.IsSuccess() ? CreateCustomModelOutcome(result.GetResultWithOwnership()) - : CreateCustomModelOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/custom-models/create-custom-model"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateCustomModelOutcome(result.GetResultWithOwnership()) + : CreateCustomModelOutcome(std::move(result.GetError())); } - CreateCustomModelDeploymentOutcome BedrockClient::CreateCustomModelDeployment(const CreateCustomModelDeploymentRequest& request) const { - AWS_OPERATION_GUARD(CreateCustomModelDeployment); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateCustomModelDeployment, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateCustomModelDeployment, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateCustomModelDeployment, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateCustomModelDeployment", - {{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( - [&]() -> CreateCustomModelDeploymentOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/model-customization/custom-model-deployments"); - }); - return result.IsSuccess() ? CreateCustomModelDeploymentOutcome(result.GetResultWithOwnership()) - : CreateCustomModelDeploymentOutcome(std::move(result.GetError())); + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/model-customization/custom-model-deployments"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateCustomModelDeploymentOutcome(result.GetResultWithOwnership()) + : CreateCustomModelDeploymentOutcome(std::move(result.GetError())); } - CreateEvaluationJobOutcome BedrockClient::CreateEvaluationJob(const CreateEvaluationJobRequest& request) const { - AWS_OPERATION_GUARD(CreateEvaluationJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateEvaluationJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateEvaluationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateEvaluationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateEvaluationJob", - {{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( - [&]() -> CreateEvaluationJobOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/evaluation-jobs"); }); - return result.IsSuccess() ? CreateEvaluationJobOutcome(result.GetResultWithOwnership()) - : CreateEvaluationJobOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/evaluation-jobs"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateEvaluationJobOutcome(result.GetResultWithOwnership()) + : CreateEvaluationJobOutcome(std::move(result.GetError())); } - CreateFoundationModelAgreementOutcome BedrockClient::CreateFoundationModelAgreement( const CreateFoundationModelAgreementRequest& request) const { - AWS_OPERATION_GUARD(CreateFoundationModelAgreement); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateFoundationModelAgreement, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateFoundationModelAgreement, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateFoundationModelAgreement, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateFoundationModelAgreement", - {{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( - [&]() -> CreateFoundationModelAgreementOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/create-foundation-model-agreement"); - }); - return result.IsSuccess() ? CreateFoundationModelAgreementOutcome(result.GetResultWithOwnership()) - : CreateFoundationModelAgreementOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/create-foundation-model-agreement"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateFoundationModelAgreementOutcome(result.GetResultWithOwnership()) + : CreateFoundationModelAgreementOutcome(std::move(result.GetError())); } - CreateGuardrailOutcome BedrockClient::CreateGuardrail(const CreateGuardrailRequest& request) const { - AWS_OPERATION_GUARD(CreateGuardrail); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateGuardrail, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateGuardrail, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateGuardrail, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateGuardrail", - {{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( - [&]() -> CreateGuardrailOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/guardrails"); }); - return result.IsSuccess() ? CreateGuardrailOutcome(result.GetResultWithOwnership()) - : CreateGuardrailOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/guardrails"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateGuardrailOutcome(result.GetResultWithOwnership()) + : CreateGuardrailOutcome(std::move(result.GetError())); } - CreateGuardrailVersionOutcome BedrockClient::CreateGuardrailVersion(const CreateGuardrailVersionRequest& request) const { - AWS_OPERATION_GUARD(CreateGuardrailVersion); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateGuardrailVersion, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.GuardrailIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("CreateGuardrailVersion", "Required field: GuardrailIdentifier, is not set"); return CreateGuardrailVersionOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [GuardrailIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateGuardrailVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateGuardrailVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateGuardrailVersion", - {{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( - [&]() -> CreateGuardrailVersionOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/guardrails/"); - resolvedEndpoint.AddPathSegment(request.GetGuardrailIdentifier()); - }); - return result.IsSuccess() ? CreateGuardrailVersionOutcome(result.GetResultWithOwnership()) - : CreateGuardrailVersionOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/guardrails/"); + resolvedEndpoint.AddPathSegment(request.GetGuardrailIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateGuardrailVersionOutcome(result.GetResultWithOwnership()) + : CreateGuardrailVersionOutcome(std::move(result.GetError())); } - CreateInferenceProfileOutcome BedrockClient::CreateInferenceProfile(const CreateInferenceProfileRequest& request) const { - AWS_OPERATION_GUARD(CreateInferenceProfile); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateInferenceProfile, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateInferenceProfile, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateInferenceProfile, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateInferenceProfile", - {{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( - [&]() -> CreateInferenceProfileOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/inference-profiles"); }); - return result.IsSuccess() ? CreateInferenceProfileOutcome(result.GetResultWithOwnership()) - : CreateInferenceProfileOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/inference-profiles"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateInferenceProfileOutcome(result.GetResultWithOwnership()) + : CreateInferenceProfileOutcome(std::move(result.GetError())); } - CreateMarketplaceModelEndpointOutcome BedrockClient::CreateMarketplaceModelEndpoint( const CreateMarketplaceModelEndpointRequest& request) const { - AWS_OPERATION_GUARD(CreateMarketplaceModelEndpoint); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateMarketplaceModelEndpoint, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateMarketplaceModelEndpoint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateMarketplaceModelEndpoint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateMarketplaceModelEndpoint", - {{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( - [&]() -> CreateMarketplaceModelEndpointOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/marketplace-model/endpoints"); - }); - return result.IsSuccess() ? CreateMarketplaceModelEndpointOutcome(result.GetResultWithOwnership()) - : CreateMarketplaceModelEndpointOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/marketplace-model/endpoints"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateMarketplaceModelEndpointOutcome(result.GetResultWithOwnership()) + : CreateMarketplaceModelEndpointOutcome(std::move(result.GetError())); } - CreateModelCopyJobOutcome BedrockClient::CreateModelCopyJob(const CreateModelCopyJobRequest& request) const { - AWS_OPERATION_GUARD(CreateModelCopyJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateModelCopyJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateModelCopyJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateModelCopyJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateModelCopyJob", - {{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( - [&]() -> CreateModelCopyJobOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/model-copy-jobs"); }); - return result.IsSuccess() ? CreateModelCopyJobOutcome(result.GetResultWithOwnership()) - : CreateModelCopyJobOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/model-copy-jobs"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateModelCopyJobOutcome(result.GetResultWithOwnership()) + : CreateModelCopyJobOutcome(std::move(result.GetError())); } - CreateModelCustomizationJobOutcome BedrockClient::CreateModelCustomizationJob(const CreateModelCustomizationJobRequest& request) const { - AWS_OPERATION_GUARD(CreateModelCustomizationJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateModelCustomizationJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateModelCustomizationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateModelCustomizationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateModelCustomizationJob", - {{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( - [&]() -> CreateModelCustomizationJobOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/model-customization-jobs"); }); - return result.IsSuccess() ? CreateModelCustomizationJobOutcome(result.GetResultWithOwnership()) - : CreateModelCustomizationJobOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/model-customization-jobs"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateModelCustomizationJobOutcome(result.GetResultWithOwnership()) + : CreateModelCustomizationJobOutcome(std::move(result.GetError())); } - CreateModelImportJobOutcome BedrockClient::CreateModelImportJob(const CreateModelImportJobRequest& request) const { - AWS_OPERATION_GUARD(CreateModelImportJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateModelImportJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateModelImportJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateModelImportJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateModelImportJob", - {{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( - [&]() -> CreateModelImportJobOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/model-import-jobs"); }); - return result.IsSuccess() ? CreateModelImportJobOutcome(result.GetResultWithOwnership()) - : CreateModelImportJobOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/model-import-jobs"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateModelImportJobOutcome(result.GetResultWithOwnership()) + : CreateModelImportJobOutcome(std::move(result.GetError())); } - CreateModelInvocationJobOutcome BedrockClient::CreateModelInvocationJob(const CreateModelInvocationJobRequest& request) const { - AWS_OPERATION_GUARD(CreateModelInvocationJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateModelInvocationJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateModelInvocationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateModelInvocationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateModelInvocationJob", - {{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( - [&]() -> CreateModelInvocationJobOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/model-invocation-job"); }); - return result.IsSuccess() ? CreateModelInvocationJobOutcome(result.GetResultWithOwnership()) - : CreateModelInvocationJobOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/model-invocation-job"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateModelInvocationJobOutcome(result.GetResultWithOwnership()) + : CreateModelInvocationJobOutcome(std::move(result.GetError())); } - CreatePromptRouterOutcome BedrockClient::CreatePromptRouter(const CreatePromptRouterRequest& request) const { - AWS_OPERATION_GUARD(CreatePromptRouter); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreatePromptRouter, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreatePromptRouter, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreatePromptRouter, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreatePromptRouter", - {{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( - [&]() -> CreatePromptRouterOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/prompt-routers"); }); - return result.IsSuccess() ? CreatePromptRouterOutcome(result.GetResultWithOwnership()) - : CreatePromptRouterOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/prompt-routers"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreatePromptRouterOutcome(result.GetResultWithOwnership()) + : CreatePromptRouterOutcome(std::move(result.GetError())); } - CreateProvisionedModelThroughputOutcome BedrockClient::CreateProvisionedModelThroughput( const CreateProvisionedModelThroughputRequest& request) const { - AWS_OPERATION_GUARD(CreateProvisionedModelThroughput); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateProvisionedModelThroughput, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateProvisionedModelThroughput, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateProvisionedModelThroughput, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateProvisionedModelThroughput", - {{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( - [&]() -> CreateProvisionedModelThroughputOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/provisioned-model-throughput"); - }); - return result.IsSuccess() ? CreateProvisionedModelThroughputOutcome(result.GetResultWithOwnership()) - : CreateProvisionedModelThroughputOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/provisioned-model-throughput"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateProvisionedModelThroughputOutcome(result.GetResultWithOwnership()) + : CreateProvisionedModelThroughputOutcome(std::move(result.GetError())); } - DeleteAutomatedReasoningPolicyOutcome BedrockClient::DeleteAutomatedReasoningPolicy( const DeleteAutomatedReasoningPolicyRequest& request) const { - AWS_OPERATION_GUARD(DeleteAutomatedReasoningPolicy); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteAutomatedReasoningPolicy, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteAutomatedReasoningPolicy", "Required field: PolicyArn, is not set"); return DeleteAutomatedReasoningPolicyOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [PolicyArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteAutomatedReasoningPolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteAutomatedReasoningPolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteAutomatedReasoningPolicy", - {{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( - [&]() -> DeleteAutomatedReasoningPolicyOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - }); - return result.IsSuccess() ? DeleteAutomatedReasoningPolicyOutcome(result.GetResultWithOwnership()) - : DeleteAutomatedReasoningPolicyOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteAutomatedReasoningPolicyOutcome(result.GetResultWithOwnership()) + : DeleteAutomatedReasoningPolicyOutcome(std::move(result.GetError())); } - DeleteAutomatedReasoningPolicyBuildWorkflowOutcome BedrockClient::DeleteAutomatedReasoningPolicyBuildWorkflow( const DeleteAutomatedReasoningPolicyBuildWorkflowRequest& request) const { - AWS_OPERATION_GUARD(DeleteAutomatedReasoningPolicyBuildWorkflow); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteAutomatedReasoningPolicyBuildWorkflow, CoreErrors, - CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteAutomatedReasoningPolicyBuildWorkflow", "Required field: PolicyArn, is not set"); return DeleteAutomatedReasoningPolicyBuildWorkflowOutcome(Aws::Client::AWSError( @@ -853,37 +528,21 @@ DeleteAutomatedReasoningPolicyBuildWorkflowOutcome BedrockClient::DeleteAutomate return DeleteAutomatedReasoningPolicyBuildWorkflowOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [LastUpdatedAt]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteAutomatedReasoningPolicyBuildWorkflow, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteAutomatedReasoningPolicyBuildWorkflow, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteAutomatedReasoningPolicyBuildWorkflow", - {{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( - [&]() -> DeleteAutomatedReasoningPolicyBuildWorkflowOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/build-workflows/"); - resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); - }); - return result.IsSuccess() ? DeleteAutomatedReasoningPolicyBuildWorkflowOutcome(result.GetResultWithOwnership()) - : DeleteAutomatedReasoningPolicyBuildWorkflowOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/build-workflows/"); + resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteAutomatedReasoningPolicyBuildWorkflowOutcome(result.GetResultWithOwnership()) + : DeleteAutomatedReasoningPolicyBuildWorkflowOutcome(std::move(result.GetError())); } - DeleteAutomatedReasoningPolicyTestCaseOutcome BedrockClient::DeleteAutomatedReasoningPolicyTestCase( const DeleteAutomatedReasoningPolicyTestCaseRequest& request) const { - AWS_OPERATION_GUARD(DeleteAutomatedReasoningPolicyTestCase); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteAutomatedReasoningPolicyTestCase, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteAutomatedReasoningPolicyTestCase", "Required field: PolicyArn, is not set"); return DeleteAutomatedReasoningPolicyTestCaseOutcome(Aws::Client::AWSError( @@ -899,519 +558,266 @@ DeleteAutomatedReasoningPolicyTestCaseOutcome BedrockClient::DeleteAutomatedReas return DeleteAutomatedReasoningPolicyTestCaseOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [LastUpdatedAt]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteAutomatedReasoningPolicyTestCase, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteAutomatedReasoningPolicyTestCase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteAutomatedReasoningPolicyTestCase", - {{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( - [&]() -> DeleteAutomatedReasoningPolicyTestCaseOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/test-cases/"); - resolvedEndpoint.AddPathSegment(request.GetTestCaseId()); - }); - return result.IsSuccess() ? DeleteAutomatedReasoningPolicyTestCaseOutcome(result.GetResultWithOwnership()) - : DeleteAutomatedReasoningPolicyTestCaseOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/test-cases/"); + resolvedEndpoint.AddPathSegment(request.GetTestCaseId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteAutomatedReasoningPolicyTestCaseOutcome(result.GetResultWithOwnership()) + : DeleteAutomatedReasoningPolicyTestCaseOutcome(std::move(result.GetError())); } - DeleteCustomModelOutcome BedrockClient::DeleteCustomModel(const DeleteCustomModelRequest& request) const { - AWS_OPERATION_GUARD(DeleteCustomModel); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteCustomModel, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ModelIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteCustomModel", "Required field: ModelIdentifier, is not set"); return DeleteCustomModelOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ModelIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteCustomModel, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteCustomModel, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteCustomModel", - {{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( - [&]() -> DeleteCustomModelOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/custom-models/"); - resolvedEndpoint.AddPathSegment(request.GetModelIdentifier()); - }); - return result.IsSuccess() ? DeleteCustomModelOutcome(result.GetResultWithOwnership()) - : DeleteCustomModelOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/custom-models/"); + resolvedEndpoint.AddPathSegment(request.GetModelIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteCustomModelOutcome(result.GetResultWithOwnership()) + : DeleteCustomModelOutcome(std::move(result.GetError())); } - DeleteCustomModelDeploymentOutcome BedrockClient::DeleteCustomModelDeployment(const DeleteCustomModelDeploymentRequest& request) const { - AWS_OPERATION_GUARD(DeleteCustomModelDeployment); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteCustomModelDeployment, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.CustomModelDeploymentIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteCustomModelDeployment", "Required field: CustomModelDeploymentIdentifier, is not set"); return DeleteCustomModelDeploymentOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [CustomModelDeploymentIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteCustomModelDeployment, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteCustomModelDeployment, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteCustomModelDeployment", - {{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( - [&]() -> DeleteCustomModelDeploymentOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/model-customization/custom-model-deployments/"); - resolvedEndpoint.AddPathSegment(request.GetCustomModelDeploymentIdentifier()); - }); - return result.IsSuccess() ? DeleteCustomModelDeploymentOutcome(result.GetResultWithOwnership()) - : DeleteCustomModelDeploymentOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/model-customization/custom-model-deployments/"); + resolvedEndpoint.AddPathSegment(request.GetCustomModelDeploymentIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteCustomModelDeploymentOutcome(result.GetResultWithOwnership()) + : DeleteCustomModelDeploymentOutcome(std::move(result.GetError())); } - DeleteEnforcedGuardrailConfigurationOutcome BedrockClient::DeleteEnforcedGuardrailConfiguration( const DeleteEnforcedGuardrailConfigurationRequest& request) const { - AWS_OPERATION_GUARD(DeleteEnforcedGuardrailConfiguration); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteEnforcedGuardrailConfiguration, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ConfigIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteEnforcedGuardrailConfiguration", "Required field: ConfigId, is not set"); return DeleteEnforcedGuardrailConfigurationOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ConfigId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteEnforcedGuardrailConfiguration, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteEnforcedGuardrailConfiguration, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteEnforcedGuardrailConfiguration", - {{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( - [&]() -> DeleteEnforcedGuardrailConfigurationOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/enforcedGuardrailsConfiguration/"); - resolvedEndpoint.AddPathSegment(request.GetConfigId()); - }); - return result.IsSuccess() ? DeleteEnforcedGuardrailConfigurationOutcome(result.GetResultWithOwnership()) - : DeleteEnforcedGuardrailConfigurationOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/enforcedGuardrailsConfiguration/"); + resolvedEndpoint.AddPathSegment(request.GetConfigId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteEnforcedGuardrailConfigurationOutcome(result.GetResultWithOwnership()) + : DeleteEnforcedGuardrailConfigurationOutcome(std::move(result.GetError())); } - DeleteFoundationModelAgreementOutcome BedrockClient::DeleteFoundationModelAgreement( const DeleteFoundationModelAgreementRequest& request) const { - AWS_OPERATION_GUARD(DeleteFoundationModelAgreement); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteFoundationModelAgreement, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteFoundationModelAgreement, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteFoundationModelAgreement, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteFoundationModelAgreement", - {{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( - [&]() -> DeleteFoundationModelAgreementOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/delete-foundation-model-agreement"); - }); - return result.IsSuccess() ? DeleteFoundationModelAgreementOutcome(result.GetResultWithOwnership()) - : DeleteFoundationModelAgreementOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/delete-foundation-model-agreement"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DeleteFoundationModelAgreementOutcome(result.GetResultWithOwnership()) + : DeleteFoundationModelAgreementOutcome(std::move(result.GetError())); } - DeleteGuardrailOutcome BedrockClient::DeleteGuardrail(const DeleteGuardrailRequest& request) const { - AWS_OPERATION_GUARD(DeleteGuardrail); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteGuardrail, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.GuardrailIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteGuardrail", "Required field: GuardrailIdentifier, is not set"); return DeleteGuardrailOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [GuardrailIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteGuardrail, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteGuardrail, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteGuardrail", - {{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( - [&]() -> DeleteGuardrailOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/guardrails/"); - resolvedEndpoint.AddPathSegment(request.GetGuardrailIdentifier()); - }); - return result.IsSuccess() ? DeleteGuardrailOutcome(result.GetResultWithOwnership()) - : DeleteGuardrailOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/guardrails/"); + resolvedEndpoint.AddPathSegment(request.GetGuardrailIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteGuardrailOutcome(result.GetResultWithOwnership()) + : DeleteGuardrailOutcome(std::move(result.GetError())); } - DeleteImportedModelOutcome BedrockClient::DeleteImportedModel(const DeleteImportedModelRequest& request) const { - AWS_OPERATION_GUARD(DeleteImportedModel); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteImportedModel, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ModelIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteImportedModel", "Required field: ModelIdentifier, is not set"); return DeleteImportedModelOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ModelIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteImportedModel, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteImportedModel, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteImportedModel", - {{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( - [&]() -> DeleteImportedModelOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/imported-models/"); - resolvedEndpoint.AddPathSegment(request.GetModelIdentifier()); - }); - return result.IsSuccess() ? DeleteImportedModelOutcome(result.GetResultWithOwnership()) - : DeleteImportedModelOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/imported-models/"); + resolvedEndpoint.AddPathSegment(request.GetModelIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteImportedModelOutcome(result.GetResultWithOwnership()) + : DeleteImportedModelOutcome(std::move(result.GetError())); } - DeleteInferenceProfileOutcome BedrockClient::DeleteInferenceProfile(const DeleteInferenceProfileRequest& request) const { - AWS_OPERATION_GUARD(DeleteInferenceProfile); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteInferenceProfile, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.InferenceProfileIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteInferenceProfile", "Required field: InferenceProfileIdentifier, is not set"); return DeleteInferenceProfileOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [InferenceProfileIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteInferenceProfile, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteInferenceProfile, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteInferenceProfile", - {{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( - [&]() -> DeleteInferenceProfileOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/inference-profiles/"); - resolvedEndpoint.AddPathSegment(request.GetInferenceProfileIdentifier()); - }); - return result.IsSuccess() ? DeleteInferenceProfileOutcome(result.GetResultWithOwnership()) - : DeleteInferenceProfileOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/inference-profiles/"); + resolvedEndpoint.AddPathSegment(request.GetInferenceProfileIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteInferenceProfileOutcome(result.GetResultWithOwnership()) + : DeleteInferenceProfileOutcome(std::move(result.GetError())); } - DeleteMarketplaceModelEndpointOutcome BedrockClient::DeleteMarketplaceModelEndpoint( const DeleteMarketplaceModelEndpointRequest& request) const { - AWS_OPERATION_GUARD(DeleteMarketplaceModelEndpoint); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteMarketplaceModelEndpoint, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.EndpointArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteMarketplaceModelEndpoint", "Required field: EndpointArn, is not set"); return DeleteMarketplaceModelEndpointOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [EndpointArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteMarketplaceModelEndpoint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteMarketplaceModelEndpoint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteMarketplaceModelEndpoint", - {{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( - [&]() -> DeleteMarketplaceModelEndpointOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/marketplace-model/endpoints/"); - resolvedEndpoint.AddPathSegment(request.GetEndpointArn()); - }); - return result.IsSuccess() ? DeleteMarketplaceModelEndpointOutcome(result.GetResultWithOwnership()) - : DeleteMarketplaceModelEndpointOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/marketplace-model/endpoints/"); + resolvedEndpoint.AddPathSegment(request.GetEndpointArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteMarketplaceModelEndpointOutcome(result.GetResultWithOwnership()) + : DeleteMarketplaceModelEndpointOutcome(std::move(result.GetError())); } - DeleteModelInvocationLoggingConfigurationOutcome BedrockClient::DeleteModelInvocationLoggingConfiguration( const DeleteModelInvocationLoggingConfigurationRequest& request) const { - AWS_OPERATION_GUARD(DeleteModelInvocationLoggingConfiguration); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteModelInvocationLoggingConfiguration, CoreErrors, - CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteModelInvocationLoggingConfiguration, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteModelInvocationLoggingConfiguration, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteModelInvocationLoggingConfiguration", - {{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( - [&]() -> DeleteModelInvocationLoggingConfigurationOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/logging/modelinvocations"); }); - return result.IsSuccess() ? DeleteModelInvocationLoggingConfigurationOutcome(result.GetResultWithOwnership()) - : DeleteModelInvocationLoggingConfigurationOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/logging/modelinvocations"); }, + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteModelInvocationLoggingConfigurationOutcome(result.GetResultWithOwnership()) + : DeleteModelInvocationLoggingConfigurationOutcome(std::move(result.GetError())); } - DeletePromptRouterOutcome BedrockClient::DeletePromptRouter(const DeletePromptRouterRequest& request) const { - AWS_OPERATION_GUARD(DeletePromptRouter); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeletePromptRouter, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PromptRouterArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeletePromptRouter", "Required field: PromptRouterArn, is not set"); return DeletePromptRouterOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [PromptRouterArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeletePromptRouter, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeletePromptRouter, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeletePromptRouter", - {{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( - [&]() -> DeletePromptRouterOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/prompt-routers/"); - resolvedEndpoint.AddPathSegment(request.GetPromptRouterArn()); - }); - return result.IsSuccess() ? DeletePromptRouterOutcome(result.GetResultWithOwnership()) - : DeletePromptRouterOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/prompt-routers/"); + resolvedEndpoint.AddPathSegment(request.GetPromptRouterArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeletePromptRouterOutcome(result.GetResultWithOwnership()) + : DeletePromptRouterOutcome(std::move(result.GetError())); } - DeleteProvisionedModelThroughputOutcome BedrockClient::DeleteProvisionedModelThroughput( const DeleteProvisionedModelThroughputRequest& request) const { - AWS_OPERATION_GUARD(DeleteProvisionedModelThroughput); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteProvisionedModelThroughput, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ProvisionedModelIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteProvisionedModelThroughput", "Required field: ProvisionedModelId, is not set"); return DeleteProvisionedModelThroughputOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ProvisionedModelId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteProvisionedModelThroughput, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteProvisionedModelThroughput, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteProvisionedModelThroughput", - {{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( - [&]() -> DeleteProvisionedModelThroughputOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/provisioned-model-throughput/"); - resolvedEndpoint.AddPathSegment(request.GetProvisionedModelId()); - }); - return result.IsSuccess() ? DeleteProvisionedModelThroughputOutcome(result.GetResultWithOwnership()) - : DeleteProvisionedModelThroughputOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/provisioned-model-throughput/"); + resolvedEndpoint.AddPathSegment(request.GetProvisionedModelId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteProvisionedModelThroughputOutcome(result.GetResultWithOwnership()) + : DeleteProvisionedModelThroughputOutcome(std::move(result.GetError())); } - DeleteResourcePolicyOutcome BedrockClient::DeleteResourcePolicy(const DeleteResourcePolicyRequest& request) const { - AWS_OPERATION_GUARD(DeleteResourcePolicy); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteResourcePolicy, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ResourceArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeleteResourcePolicy", "Required field: ResourceArn, is not set"); return DeleteResourcePolicyOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ResourceArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteResourcePolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteResourcePolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteResourcePolicy", - {{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( - [&]() -> DeleteResourcePolicyOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/resource-policy/"); - resolvedEndpoint.AddPathSegment(request.GetResourceArn()); - }); - return result.IsSuccess() ? DeleteResourcePolicyOutcome(result.GetResultWithOwnership()) - : DeleteResourcePolicyOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/resource-policy/"); + resolvedEndpoint.AddPathSegment(request.GetResourceArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeleteResourcePolicyOutcome(result.GetResultWithOwnership()) + : DeleteResourcePolicyOutcome(std::move(result.GetError())); } - DeregisterMarketplaceModelEndpointOutcome BedrockClient::DeregisterMarketplaceModelEndpoint( const DeregisterMarketplaceModelEndpointRequest& request) const { - AWS_OPERATION_GUARD(DeregisterMarketplaceModelEndpoint); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeregisterMarketplaceModelEndpoint, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.EndpointArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("DeregisterMarketplaceModelEndpoint", "Required field: EndpointArn, is not set"); return DeregisterMarketplaceModelEndpointOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [EndpointArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeregisterMarketplaceModelEndpoint, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeregisterMarketplaceModelEndpoint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeregisterMarketplaceModelEndpoint", - {{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( - [&]() -> DeregisterMarketplaceModelEndpointOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_DELETE, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/marketplace-model/endpoints/"); - resolvedEndpoint.AddPathSegment(request.GetEndpointArn()); - resolvedEndpoint.AddPathSegments("/registration"); - }); - return result.IsSuccess() ? DeregisterMarketplaceModelEndpointOutcome(result.GetResultWithOwnership()) - : DeregisterMarketplaceModelEndpointOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/marketplace-model/endpoints/"); + resolvedEndpoint.AddPathSegment(request.GetEndpointArn()); + resolvedEndpoint.AddPathSegments("/registration"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_DELETE); + return result.IsSuccess() ? DeregisterMarketplaceModelEndpointOutcome(result.GetResultWithOwnership()) + : DeregisterMarketplaceModelEndpointOutcome(std::move(result.GetError())); } - ExportAutomatedReasoningPolicyVersionOutcome BedrockClient::ExportAutomatedReasoningPolicyVersion( const ExportAutomatedReasoningPolicyVersionRequest& request) const { - AWS_OPERATION_GUARD(ExportAutomatedReasoningPolicyVersion); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ExportAutomatedReasoningPolicyVersion, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("ExportAutomatedReasoningPolicyVersion", "Required field: PolicyArn, is not set"); return ExportAutomatedReasoningPolicyVersionOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [PolicyArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ExportAutomatedReasoningPolicyVersion, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ExportAutomatedReasoningPolicyVersion, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ExportAutomatedReasoningPolicyVersion", - {{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( - [&]() -> ExportAutomatedReasoningPolicyVersionOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/export"); - }); - return result.IsSuccess() ? ExportAutomatedReasoningPolicyVersionOutcome(result.GetResultWithOwnership()) - : ExportAutomatedReasoningPolicyVersionOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/export"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ExportAutomatedReasoningPolicyVersionOutcome(result.GetResultWithOwnership()) + : ExportAutomatedReasoningPolicyVersionOutcome(std::move(result.GetError())); } - GetAutomatedReasoningPolicyOutcome BedrockClient::GetAutomatedReasoningPolicy(const GetAutomatedReasoningPolicyRequest& request) const { - AWS_OPERATION_GUARD(GetAutomatedReasoningPolicy); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetAutomatedReasoningPolicy, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetAutomatedReasoningPolicy", "Required field: PolicyArn, is not set"); return GetAutomatedReasoningPolicyOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [PolicyArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetAutomatedReasoningPolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetAutomatedReasoningPolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetAutomatedReasoningPolicy", - {{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( - [&]() -> GetAutomatedReasoningPolicyOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - }); - return result.IsSuccess() ? GetAutomatedReasoningPolicyOutcome(result.GetResultWithOwnership()) - : GetAutomatedReasoningPolicyOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetAutomatedReasoningPolicyOutcome(result.GetResultWithOwnership()) + : GetAutomatedReasoningPolicyOutcome(std::move(result.GetError())); } - GetAutomatedReasoningPolicyAnnotationsOutcome BedrockClient::GetAutomatedReasoningPolicyAnnotations( const GetAutomatedReasoningPolicyAnnotationsRequest& request) const { - AWS_OPERATION_GUARD(GetAutomatedReasoningPolicyAnnotations); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetAutomatedReasoningPolicyAnnotations, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetAutomatedReasoningPolicyAnnotations", "Required field: PolicyArn, is not set"); return GetAutomatedReasoningPolicyAnnotationsOutcome(Aws::Client::AWSError( @@ -1422,39 +828,22 @@ GetAutomatedReasoningPolicyAnnotationsOutcome BedrockClient::GetAutomatedReasoni return GetAutomatedReasoningPolicyAnnotationsOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [BuildWorkflowId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetAutomatedReasoningPolicyAnnotations, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetAutomatedReasoningPolicyAnnotations, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetAutomatedReasoningPolicyAnnotations", - {{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( - [&]() -> GetAutomatedReasoningPolicyAnnotationsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/build-workflows/"); - resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); - resolvedEndpoint.AddPathSegments("/annotations"); - }); - return result.IsSuccess() ? GetAutomatedReasoningPolicyAnnotationsOutcome(result.GetResultWithOwnership()) - : GetAutomatedReasoningPolicyAnnotationsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/build-workflows/"); + resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); + resolvedEndpoint.AddPathSegments("/annotations"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetAutomatedReasoningPolicyAnnotationsOutcome(result.GetResultWithOwnership()) + : GetAutomatedReasoningPolicyAnnotationsOutcome(std::move(result.GetError())); } - GetAutomatedReasoningPolicyBuildWorkflowOutcome BedrockClient::GetAutomatedReasoningPolicyBuildWorkflow( const GetAutomatedReasoningPolicyBuildWorkflowRequest& request) const { - AWS_OPERATION_GUARD(GetAutomatedReasoningPolicyBuildWorkflow); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetAutomatedReasoningPolicyBuildWorkflow, CoreErrors, - CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetAutomatedReasoningPolicyBuildWorkflow", "Required field: PolicyArn, is not set"); return GetAutomatedReasoningPolicyBuildWorkflowOutcome(Aws::Client::AWSError( @@ -1465,38 +854,21 @@ GetAutomatedReasoningPolicyBuildWorkflowOutcome BedrockClient::GetAutomatedReaso return GetAutomatedReasoningPolicyBuildWorkflowOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [BuildWorkflowId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetAutomatedReasoningPolicyBuildWorkflow, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetAutomatedReasoningPolicyBuildWorkflow, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetAutomatedReasoningPolicyBuildWorkflow", - {{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( - [&]() -> GetAutomatedReasoningPolicyBuildWorkflowOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/build-workflows/"); - resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); - }); - return result.IsSuccess() ? GetAutomatedReasoningPolicyBuildWorkflowOutcome(result.GetResultWithOwnership()) - : GetAutomatedReasoningPolicyBuildWorkflowOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/build-workflows/"); + resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetAutomatedReasoningPolicyBuildWorkflowOutcome(result.GetResultWithOwnership()) + : GetAutomatedReasoningPolicyBuildWorkflowOutcome(std::move(result.GetError())); } - GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutcome BedrockClient::GetAutomatedReasoningPolicyBuildWorkflowResultAssets( const GetAutomatedReasoningPolicyBuildWorkflowResultAssetsRequest& request) const { - AWS_OPERATION_GUARD(GetAutomatedReasoningPolicyBuildWorkflowResultAssets); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetAutomatedReasoningPolicyBuildWorkflowResultAssets, CoreErrors, - CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetAutomatedReasoningPolicyBuildWorkflowResultAssets", "Required field: PolicyArn, is not set"); return GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutcome(Aws::Client::AWSError( @@ -1512,38 +884,22 @@ GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutcome BedrockClient::GetAu return GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AssetType]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetAutomatedReasoningPolicyBuildWorkflowResultAssets, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetAutomatedReasoningPolicyBuildWorkflowResultAssets, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetAutomatedReasoningPolicyBuildWorkflowResultAssets", - {{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( - [&]() -> GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/build-workflows/"); - resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); - resolvedEndpoint.AddPathSegments("/result-assets"); - }); - return result.IsSuccess() ? GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutcome(result.GetResultWithOwnership()) - : GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/build-workflows/"); + resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); + resolvedEndpoint.AddPathSegments("/result-assets"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutcome(result.GetResultWithOwnership()) + : GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutcome(std::move(result.GetError())); } - GetAutomatedReasoningPolicyNextScenarioOutcome BedrockClient::GetAutomatedReasoningPolicyNextScenario( const GetAutomatedReasoningPolicyNextScenarioRequest& request) const { - AWS_OPERATION_GUARD(GetAutomatedReasoningPolicyNextScenario); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetAutomatedReasoningPolicyNextScenario, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetAutomatedReasoningPolicyNextScenario", "Required field: PolicyArn, is not set"); return GetAutomatedReasoningPolicyNextScenarioOutcome(Aws::Client::AWSError( @@ -1554,38 +910,22 @@ GetAutomatedReasoningPolicyNextScenarioOutcome BedrockClient::GetAutomatedReason return GetAutomatedReasoningPolicyNextScenarioOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [BuildWorkflowId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetAutomatedReasoningPolicyNextScenario, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetAutomatedReasoningPolicyNextScenario, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetAutomatedReasoningPolicyNextScenario", - {{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( - [&]() -> GetAutomatedReasoningPolicyNextScenarioOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/build-workflows/"); - resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); - resolvedEndpoint.AddPathSegments("/scenarios"); - }); - return result.IsSuccess() ? GetAutomatedReasoningPolicyNextScenarioOutcome(result.GetResultWithOwnership()) - : GetAutomatedReasoningPolicyNextScenarioOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/build-workflows/"); + resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); + resolvedEndpoint.AddPathSegments("/scenarios"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetAutomatedReasoningPolicyNextScenarioOutcome(result.GetResultWithOwnership()) + : GetAutomatedReasoningPolicyNextScenarioOutcome(std::move(result.GetError())); } - GetAutomatedReasoningPolicyTestCaseOutcome BedrockClient::GetAutomatedReasoningPolicyTestCase( const GetAutomatedReasoningPolicyTestCaseRequest& request) const { - AWS_OPERATION_GUARD(GetAutomatedReasoningPolicyTestCase); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetAutomatedReasoningPolicyTestCase, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetAutomatedReasoningPolicyTestCase", "Required field: PolicyArn, is not set"); return GetAutomatedReasoningPolicyTestCaseOutcome(Aws::Client::AWSError( @@ -1596,37 +936,21 @@ GetAutomatedReasoningPolicyTestCaseOutcome BedrockClient::GetAutomatedReasoningP return GetAutomatedReasoningPolicyTestCaseOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [TestCaseId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetAutomatedReasoningPolicyTestCase, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetAutomatedReasoningPolicyTestCase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetAutomatedReasoningPolicyTestCase", - {{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( - [&]() -> GetAutomatedReasoningPolicyTestCaseOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/test-cases/"); - resolvedEndpoint.AddPathSegment(request.GetTestCaseId()); - }); - return result.IsSuccess() ? GetAutomatedReasoningPolicyTestCaseOutcome(result.GetResultWithOwnership()) - : GetAutomatedReasoningPolicyTestCaseOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/test-cases/"); + resolvedEndpoint.AddPathSegment(request.GetTestCaseId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetAutomatedReasoningPolicyTestCaseOutcome(result.GetResultWithOwnership()) + : GetAutomatedReasoningPolicyTestCaseOutcome(std::move(result.GetError())); } - GetAutomatedReasoningPolicyTestResultOutcome BedrockClient::GetAutomatedReasoningPolicyTestResult( const GetAutomatedReasoningPolicyTestResultRequest& request) const { - AWS_OPERATION_GUARD(GetAutomatedReasoningPolicyTestResult); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetAutomatedReasoningPolicyTestResult, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetAutomatedReasoningPolicyTestResult", "Required field: PolicyArn, is not set"); return GetAutomatedReasoningPolicyTestResultOutcome(Aws::Client::AWSError( @@ -1642,704 +966,357 @@ GetAutomatedReasoningPolicyTestResultOutcome BedrockClient::GetAutomatedReasonin return GetAutomatedReasoningPolicyTestResultOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [TestCaseId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetAutomatedReasoningPolicyTestResult, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetAutomatedReasoningPolicyTestResult, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetAutomatedReasoningPolicyTestResult", - {{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( - [&]() -> GetAutomatedReasoningPolicyTestResultOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/build-workflows/"); - resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); - resolvedEndpoint.AddPathSegments("/test-cases/"); - resolvedEndpoint.AddPathSegment(request.GetTestCaseId()); - resolvedEndpoint.AddPathSegments("/test-results"); - }); - return result.IsSuccess() ? GetAutomatedReasoningPolicyTestResultOutcome(result.GetResultWithOwnership()) - : GetAutomatedReasoningPolicyTestResultOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/build-workflows/"); + resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); + resolvedEndpoint.AddPathSegments("/test-cases/"); + resolvedEndpoint.AddPathSegment(request.GetTestCaseId()); + resolvedEndpoint.AddPathSegments("/test-results"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetAutomatedReasoningPolicyTestResultOutcome(result.GetResultWithOwnership()) + : GetAutomatedReasoningPolicyTestResultOutcome(std::move(result.GetError())); } - GetCustomModelOutcome BedrockClient::GetCustomModel(const GetCustomModelRequest& request) const { - AWS_OPERATION_GUARD(GetCustomModel); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetCustomModel, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ModelIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetCustomModel", "Required field: ModelIdentifier, is not set"); return GetCustomModelOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ModelIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetCustomModel, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetCustomModel, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetCustomModel", - {{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( - [&]() -> GetCustomModelOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/custom-models/"); - resolvedEndpoint.AddPathSegment(request.GetModelIdentifier()); - }); - return result.IsSuccess() ? GetCustomModelOutcome(result.GetResultWithOwnership()) - : GetCustomModelOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/custom-models/"); + resolvedEndpoint.AddPathSegment(request.GetModelIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetCustomModelOutcome(result.GetResultWithOwnership()) : GetCustomModelOutcome(std::move(result.GetError())); } - GetCustomModelDeploymentOutcome BedrockClient::GetCustomModelDeployment(const GetCustomModelDeploymentRequest& request) const { - AWS_OPERATION_GUARD(GetCustomModelDeployment); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetCustomModelDeployment, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.CustomModelDeploymentIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetCustomModelDeployment", "Required field: CustomModelDeploymentIdentifier, is not set"); return GetCustomModelDeploymentOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [CustomModelDeploymentIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetCustomModelDeployment, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetCustomModelDeployment, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetCustomModelDeployment", - {{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( - [&]() -> GetCustomModelDeploymentOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/model-customization/custom-model-deployments/"); - resolvedEndpoint.AddPathSegment(request.GetCustomModelDeploymentIdentifier()); - }); - return result.IsSuccess() ? GetCustomModelDeploymentOutcome(result.GetResultWithOwnership()) - : GetCustomModelDeploymentOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/model-customization/custom-model-deployments/"); + resolvedEndpoint.AddPathSegment(request.GetCustomModelDeploymentIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetCustomModelDeploymentOutcome(result.GetResultWithOwnership()) + : GetCustomModelDeploymentOutcome(std::move(result.GetError())); } - GetEvaluationJobOutcome BedrockClient::GetEvaluationJob(const GetEvaluationJobRequest& request) const { - AWS_OPERATION_GUARD(GetEvaluationJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetEvaluationJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.JobIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetEvaluationJob", "Required field: JobIdentifier, is not set"); return GetEvaluationJobOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [JobIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetEvaluationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetEvaluationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetEvaluationJob", - {{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( - [&]() -> GetEvaluationJobOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/evaluation-jobs/"); - resolvedEndpoint.AddPathSegment(request.GetJobIdentifier()); - }); - return result.IsSuccess() ? GetEvaluationJobOutcome(result.GetResultWithOwnership()) - : GetEvaluationJobOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/evaluation-jobs/"); + resolvedEndpoint.AddPathSegment(request.GetJobIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetEvaluationJobOutcome(result.GetResultWithOwnership()) + : GetEvaluationJobOutcome(std::move(result.GetError())); } - GetFoundationModelOutcome BedrockClient::GetFoundationModel(const GetFoundationModelRequest& request) const { - AWS_OPERATION_GUARD(GetFoundationModel); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetFoundationModel, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ModelIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetFoundationModel", "Required field: ModelIdentifier, is not set"); return GetFoundationModelOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ModelIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetFoundationModel, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetFoundationModel, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetFoundationModel", - {{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( - [&]() -> GetFoundationModelOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/foundation-models/"); - resolvedEndpoint.AddPathSegment(request.GetModelIdentifier()); - }); - return result.IsSuccess() ? GetFoundationModelOutcome(result.GetResultWithOwnership()) - : GetFoundationModelOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/foundation-models/"); + resolvedEndpoint.AddPathSegment(request.GetModelIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetFoundationModelOutcome(result.GetResultWithOwnership()) + : GetFoundationModelOutcome(std::move(result.GetError())); } - GetFoundationModelAvailabilityOutcome BedrockClient::GetFoundationModelAvailability( const GetFoundationModelAvailabilityRequest& request) const { - AWS_OPERATION_GUARD(GetFoundationModelAvailability); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetFoundationModelAvailability, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ModelIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetFoundationModelAvailability", "Required field: ModelId, is not set"); return GetFoundationModelAvailabilityOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ModelId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetFoundationModelAvailability, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetFoundationModelAvailability, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetFoundationModelAvailability", - {{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( - [&]() -> GetFoundationModelAvailabilityOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/foundation-model-availability/"); - resolvedEndpoint.AddPathSegment(request.GetModelId()); - }); - return result.IsSuccess() ? GetFoundationModelAvailabilityOutcome(result.GetResultWithOwnership()) - : GetFoundationModelAvailabilityOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/foundation-model-availability/"); + resolvedEndpoint.AddPathSegment(request.GetModelId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetFoundationModelAvailabilityOutcome(result.GetResultWithOwnership()) + : GetFoundationModelAvailabilityOutcome(std::move(result.GetError())); } - GetGuardrailOutcome BedrockClient::GetGuardrail(const GetGuardrailRequest& request) const { - AWS_OPERATION_GUARD(GetGuardrail); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetGuardrail, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.GuardrailIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetGuardrail", "Required field: GuardrailIdentifier, is not set"); return GetGuardrailOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [GuardrailIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetGuardrail, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetGuardrail, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetGuardrail", - {{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( - [&]() -> GetGuardrailOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/guardrails/"); - resolvedEndpoint.AddPathSegment(request.GetGuardrailIdentifier()); - }); - return result.IsSuccess() ? GetGuardrailOutcome(result.GetResultWithOwnership()) - : GetGuardrailOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/guardrails/"); + resolvedEndpoint.AddPathSegment(request.GetGuardrailIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetGuardrailOutcome(result.GetResultWithOwnership()) : GetGuardrailOutcome(std::move(result.GetError())); } - GetImportedModelOutcome BedrockClient::GetImportedModel(const GetImportedModelRequest& request) const { - AWS_OPERATION_GUARD(GetImportedModel); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetImportedModel, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ModelIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetImportedModel", "Required field: ModelIdentifier, is not set"); return GetImportedModelOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ModelIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetImportedModel, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetImportedModel, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetImportedModel", - {{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( - [&]() -> GetImportedModelOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/imported-models/"); - resolvedEndpoint.AddPathSegment(request.GetModelIdentifier()); - }); - return result.IsSuccess() ? GetImportedModelOutcome(result.GetResultWithOwnership()) - : GetImportedModelOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/imported-models/"); + resolvedEndpoint.AddPathSegment(request.GetModelIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetImportedModelOutcome(result.GetResultWithOwnership()) + : GetImportedModelOutcome(std::move(result.GetError())); } - GetInferenceProfileOutcome BedrockClient::GetInferenceProfile(const GetInferenceProfileRequest& request) const { - AWS_OPERATION_GUARD(GetInferenceProfile); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetInferenceProfile, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.InferenceProfileIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetInferenceProfile", "Required field: InferenceProfileIdentifier, is not set"); return GetInferenceProfileOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [InferenceProfileIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetInferenceProfile, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetInferenceProfile, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetInferenceProfile", - {{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( - [&]() -> GetInferenceProfileOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/inference-profiles/"); - resolvedEndpoint.AddPathSegment(request.GetInferenceProfileIdentifier()); - }); - return result.IsSuccess() ? GetInferenceProfileOutcome(result.GetResultWithOwnership()) - : GetInferenceProfileOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/inference-profiles/"); + resolvedEndpoint.AddPathSegment(request.GetInferenceProfileIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetInferenceProfileOutcome(result.GetResultWithOwnership()) + : GetInferenceProfileOutcome(std::move(result.GetError())); } - GetMarketplaceModelEndpointOutcome BedrockClient::GetMarketplaceModelEndpoint(const GetMarketplaceModelEndpointRequest& request) const { - AWS_OPERATION_GUARD(GetMarketplaceModelEndpoint); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetMarketplaceModelEndpoint, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.EndpointArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetMarketplaceModelEndpoint", "Required field: EndpointArn, is not set"); return GetMarketplaceModelEndpointOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [EndpointArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetMarketplaceModelEndpoint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetMarketplaceModelEndpoint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetMarketplaceModelEndpoint", - {{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( - [&]() -> GetMarketplaceModelEndpointOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/marketplace-model/endpoints/"); - resolvedEndpoint.AddPathSegment(request.GetEndpointArn()); - }); - return result.IsSuccess() ? GetMarketplaceModelEndpointOutcome(result.GetResultWithOwnership()) - : GetMarketplaceModelEndpointOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/marketplace-model/endpoints/"); + resolvedEndpoint.AddPathSegment(request.GetEndpointArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetMarketplaceModelEndpointOutcome(result.GetResultWithOwnership()) + : GetMarketplaceModelEndpointOutcome(std::move(result.GetError())); } - GetModelCopyJobOutcome BedrockClient::GetModelCopyJob(const GetModelCopyJobRequest& request) const { - AWS_OPERATION_GUARD(GetModelCopyJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetModelCopyJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.JobArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetModelCopyJob", "Required field: JobArn, is not set"); return GetModelCopyJobOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [JobArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetModelCopyJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetModelCopyJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetModelCopyJob", - {{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( - [&]() -> GetModelCopyJobOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/model-copy-jobs/"); - resolvedEndpoint.AddPathSegment(request.GetJobArn()); - }); - return result.IsSuccess() ? GetModelCopyJobOutcome(result.GetResultWithOwnership()) - : GetModelCopyJobOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/model-copy-jobs/"); + resolvedEndpoint.AddPathSegment(request.GetJobArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetModelCopyJobOutcome(result.GetResultWithOwnership()) + : GetModelCopyJobOutcome(std::move(result.GetError())); } - GetModelCustomizationJobOutcome BedrockClient::GetModelCustomizationJob(const GetModelCustomizationJobRequest& request) const { - AWS_OPERATION_GUARD(GetModelCustomizationJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetModelCustomizationJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.JobIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetModelCustomizationJob", "Required field: JobIdentifier, is not set"); return GetModelCustomizationJobOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [JobIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetModelCustomizationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetModelCustomizationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetModelCustomizationJob", - {{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( - [&]() -> GetModelCustomizationJobOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/model-customization-jobs/"); - resolvedEndpoint.AddPathSegment(request.GetJobIdentifier()); - }); - return result.IsSuccess() ? GetModelCustomizationJobOutcome(result.GetResultWithOwnership()) - : GetModelCustomizationJobOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/model-customization-jobs/"); + resolvedEndpoint.AddPathSegment(request.GetJobIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetModelCustomizationJobOutcome(result.GetResultWithOwnership()) + : GetModelCustomizationJobOutcome(std::move(result.GetError())); } - GetModelImportJobOutcome BedrockClient::GetModelImportJob(const GetModelImportJobRequest& request) const { - AWS_OPERATION_GUARD(GetModelImportJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetModelImportJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.JobIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetModelImportJob", "Required field: JobIdentifier, is not set"); return GetModelImportJobOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [JobIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetModelImportJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetModelImportJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetModelImportJob", - {{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( - [&]() -> GetModelImportJobOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/model-import-jobs/"); - resolvedEndpoint.AddPathSegment(request.GetJobIdentifier()); - }); - return result.IsSuccess() ? GetModelImportJobOutcome(result.GetResultWithOwnership()) - : GetModelImportJobOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/model-import-jobs/"); + resolvedEndpoint.AddPathSegment(request.GetJobIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetModelImportJobOutcome(result.GetResultWithOwnership()) + : GetModelImportJobOutcome(std::move(result.GetError())); } - GetModelInvocationJobOutcome BedrockClient::GetModelInvocationJob(const GetModelInvocationJobRequest& request) const { - AWS_OPERATION_GUARD(GetModelInvocationJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetModelInvocationJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.JobIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetModelInvocationJob", "Required field: JobIdentifier, is not set"); return GetModelInvocationJobOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [JobIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetModelInvocationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetModelInvocationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetModelInvocationJob", - {{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( - [&]() -> GetModelInvocationJobOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/model-invocation-job/"); - resolvedEndpoint.AddPathSegment(request.GetJobIdentifier()); - }); - return result.IsSuccess() ? GetModelInvocationJobOutcome(result.GetResultWithOwnership()) - : GetModelInvocationJobOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/model-invocation-job/"); + resolvedEndpoint.AddPathSegment(request.GetJobIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetModelInvocationJobOutcome(result.GetResultWithOwnership()) + : GetModelInvocationJobOutcome(std::move(result.GetError())); } - GetModelInvocationLoggingConfigurationOutcome BedrockClient::GetModelInvocationLoggingConfiguration( const GetModelInvocationLoggingConfigurationRequest& request) const { - AWS_OPERATION_GUARD(GetModelInvocationLoggingConfiguration); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetModelInvocationLoggingConfiguration, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetModelInvocationLoggingConfiguration, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetModelInvocationLoggingConfiguration, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetModelInvocationLoggingConfiguration", - {{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( - [&]() -> GetModelInvocationLoggingConfigurationOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/logging/modelinvocations"); }); - return result.IsSuccess() ? GetModelInvocationLoggingConfigurationOutcome(result.GetResultWithOwnership()) - : GetModelInvocationLoggingConfigurationOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/logging/modelinvocations"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetModelInvocationLoggingConfigurationOutcome(result.GetResultWithOwnership()) + : GetModelInvocationLoggingConfigurationOutcome(std::move(result.GetError())); } - GetPromptRouterOutcome BedrockClient::GetPromptRouter(const GetPromptRouterRequest& request) const { - AWS_OPERATION_GUARD(GetPromptRouter); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetPromptRouter, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PromptRouterArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetPromptRouter", "Required field: PromptRouterArn, is not set"); return GetPromptRouterOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [PromptRouterArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetPromptRouter, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetPromptRouter, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetPromptRouter", - {{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( - [&]() -> GetPromptRouterOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/prompt-routers/"); - resolvedEndpoint.AddPathSegment(request.GetPromptRouterArn()); - }); - return result.IsSuccess() ? GetPromptRouterOutcome(result.GetResultWithOwnership()) - : GetPromptRouterOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/prompt-routers/"); + resolvedEndpoint.AddPathSegment(request.GetPromptRouterArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetPromptRouterOutcome(result.GetResultWithOwnership()) + : GetPromptRouterOutcome(std::move(result.GetError())); } - GetProvisionedModelThroughputOutcome BedrockClient::GetProvisionedModelThroughput( const GetProvisionedModelThroughputRequest& request) const { - AWS_OPERATION_GUARD(GetProvisionedModelThroughput); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetProvisionedModelThroughput, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ProvisionedModelIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetProvisionedModelThroughput", "Required field: ProvisionedModelId, is not set"); return GetProvisionedModelThroughputOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ProvisionedModelId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetProvisionedModelThroughput, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetProvisionedModelThroughput, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetProvisionedModelThroughput", - {{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( - [&]() -> GetProvisionedModelThroughputOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/provisioned-model-throughput/"); - resolvedEndpoint.AddPathSegment(request.GetProvisionedModelId()); - }); - return result.IsSuccess() ? GetProvisionedModelThroughputOutcome(result.GetResultWithOwnership()) - : GetProvisionedModelThroughputOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/provisioned-model-throughput/"); + resolvedEndpoint.AddPathSegment(request.GetProvisionedModelId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetProvisionedModelThroughputOutcome(result.GetResultWithOwnership()) + : GetProvisionedModelThroughputOutcome(std::move(result.GetError())); } - GetResourcePolicyOutcome BedrockClient::GetResourcePolicy(const GetResourcePolicyRequest& request) const { - AWS_OPERATION_GUARD(GetResourcePolicy); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetResourcePolicy, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ResourceArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("GetResourcePolicy", "Required field: ResourceArn, is not set"); return GetResourcePolicyOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ResourceArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetResourcePolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetResourcePolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetResourcePolicy", - {{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( - [&]() -> GetResourcePolicyOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/resource-policy/"); - resolvedEndpoint.AddPathSegment(request.GetResourceArn()); - }); - return result.IsSuccess() ? GetResourcePolicyOutcome(result.GetResultWithOwnership()) - : GetResourcePolicyOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/resource-policy/"); + resolvedEndpoint.AddPathSegment(request.GetResourceArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetResourcePolicyOutcome(result.GetResultWithOwnership()) + : GetResourcePolicyOutcome(std::move(result.GetError())); } - GetUseCaseForModelAccessOutcome BedrockClient::GetUseCaseForModelAccess(const GetUseCaseForModelAccessRequest& request) const { - AWS_OPERATION_GUARD(GetUseCaseForModelAccess); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetUseCaseForModelAccess, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetUseCaseForModelAccess, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetUseCaseForModelAccess, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetUseCaseForModelAccess", - {{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( - [&]() -> GetUseCaseForModelAccessOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/use-case-for-model-access"); }); - return result.IsSuccess() ? GetUseCaseForModelAccessOutcome(result.GetResultWithOwnership()) - : GetUseCaseForModelAccessOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/use-case-for-model-access"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? GetUseCaseForModelAccessOutcome(result.GetResultWithOwnership()) + : GetUseCaseForModelAccessOutcome(std::move(result.GetError())); } - ListAutomatedReasoningPoliciesOutcome BedrockClient::ListAutomatedReasoningPolicies( const ListAutomatedReasoningPoliciesRequest& request) const { - AWS_OPERATION_GUARD(ListAutomatedReasoningPolicies); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListAutomatedReasoningPolicies, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListAutomatedReasoningPolicies, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListAutomatedReasoningPolicies, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListAutomatedReasoningPolicies", - {{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( - [&]() -> ListAutomatedReasoningPoliciesOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies"); - }); - return result.IsSuccess() ? ListAutomatedReasoningPoliciesOutcome(result.GetResultWithOwnership()) - : ListAutomatedReasoningPoliciesOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/automated-reasoning-policies"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListAutomatedReasoningPoliciesOutcome(result.GetResultWithOwnership()) + : ListAutomatedReasoningPoliciesOutcome(std::move(result.GetError())); } - ListAutomatedReasoningPolicyBuildWorkflowsOutcome BedrockClient::ListAutomatedReasoningPolicyBuildWorkflows( const ListAutomatedReasoningPolicyBuildWorkflowsRequest& request) const { - AWS_OPERATION_GUARD(ListAutomatedReasoningPolicyBuildWorkflows); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListAutomatedReasoningPolicyBuildWorkflows, CoreErrors, - CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListAutomatedReasoningPolicyBuildWorkflows", "Required field: PolicyArn, is not set"); return ListAutomatedReasoningPolicyBuildWorkflowsOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [PolicyArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListAutomatedReasoningPolicyBuildWorkflows, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListAutomatedReasoningPolicyBuildWorkflows, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListAutomatedReasoningPolicyBuildWorkflows", - {{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( - [&]() -> ListAutomatedReasoningPolicyBuildWorkflowsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/build-workflows"); - }); - return result.IsSuccess() ? ListAutomatedReasoningPolicyBuildWorkflowsOutcome(result.GetResultWithOwnership()) - : ListAutomatedReasoningPolicyBuildWorkflowsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/build-workflows"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListAutomatedReasoningPolicyBuildWorkflowsOutcome(result.GetResultWithOwnership()) + : ListAutomatedReasoningPolicyBuildWorkflowsOutcome(std::move(result.GetError())); } - ListAutomatedReasoningPolicyTestCasesOutcome BedrockClient::ListAutomatedReasoningPolicyTestCases( const ListAutomatedReasoningPolicyTestCasesRequest& request) const { - AWS_OPERATION_GUARD(ListAutomatedReasoningPolicyTestCases); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListAutomatedReasoningPolicyTestCases, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListAutomatedReasoningPolicyTestCases", "Required field: PolicyArn, is not set"); return ListAutomatedReasoningPolicyTestCasesOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [PolicyArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListAutomatedReasoningPolicyTestCases, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListAutomatedReasoningPolicyTestCases, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListAutomatedReasoningPolicyTestCases", - {{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( - [&]() -> ListAutomatedReasoningPolicyTestCasesOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/test-cases"); - }); - return result.IsSuccess() ? ListAutomatedReasoningPolicyTestCasesOutcome(result.GetResultWithOwnership()) - : ListAutomatedReasoningPolicyTestCasesOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/test-cases"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListAutomatedReasoningPolicyTestCasesOutcome(result.GetResultWithOwnership()) + : ListAutomatedReasoningPolicyTestCasesOutcome(std::move(result.GetError())); } - ListAutomatedReasoningPolicyTestResultsOutcome BedrockClient::ListAutomatedReasoningPolicyTestResults( const ListAutomatedReasoningPolicyTestResultsRequest& request) const { - AWS_OPERATION_GUARD(ListAutomatedReasoningPolicyTestResults); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListAutomatedReasoningPolicyTestResults, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListAutomatedReasoningPolicyTestResults", "Required field: PolicyArn, is not set"); return ListAutomatedReasoningPolicyTestResultsOutcome(Aws::Client::AWSError( @@ -2350,622 +1327,206 @@ ListAutomatedReasoningPolicyTestResultsOutcome BedrockClient::ListAutomatedReaso return ListAutomatedReasoningPolicyTestResultsOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [BuildWorkflowId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListAutomatedReasoningPolicyTestResults, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListAutomatedReasoningPolicyTestResults, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListAutomatedReasoningPolicyTestResults", - {{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( - [&]() -> ListAutomatedReasoningPolicyTestResultsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/build-workflows/"); - resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); - resolvedEndpoint.AddPathSegments("/test-results"); - }); - return result.IsSuccess() ? ListAutomatedReasoningPolicyTestResultsOutcome(result.GetResultWithOwnership()) - : ListAutomatedReasoningPolicyTestResultsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/build-workflows/"); + resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); + resolvedEndpoint.AddPathSegments("/test-results"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListAutomatedReasoningPolicyTestResultsOutcome(result.GetResultWithOwnership()) + : ListAutomatedReasoningPolicyTestResultsOutcome(std::move(result.GetError())); } - ListCustomModelDeploymentsOutcome BedrockClient::ListCustomModelDeployments(const ListCustomModelDeploymentsRequest& request) const { - AWS_OPERATION_GUARD(ListCustomModelDeployments); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListCustomModelDeployments, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListCustomModelDeployments, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListCustomModelDeployments, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListCustomModelDeployments", - {{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( - [&]() -> ListCustomModelDeploymentsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/model-customization/custom-model-deployments"); - }); - return result.IsSuccess() ? ListCustomModelDeploymentsOutcome(result.GetResultWithOwnership()) - : ListCustomModelDeploymentsOutcome(std::move(result.GetError())); + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/model-customization/custom-model-deployments"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListCustomModelDeploymentsOutcome(result.GetResultWithOwnership()) + : ListCustomModelDeploymentsOutcome(std::move(result.GetError())); } - ListCustomModelsOutcome BedrockClient::ListCustomModels(const ListCustomModelsRequest& request) const { - AWS_OPERATION_GUARD(ListCustomModels); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListCustomModels, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListCustomModels, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListCustomModels, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListCustomModels", - {{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( - [&]() -> ListCustomModelsOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/custom-models"); }); - return result.IsSuccess() ? ListCustomModelsOutcome(result.GetResultWithOwnership()) - : ListCustomModelsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/custom-models"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListCustomModelsOutcome(result.GetResultWithOwnership()) + : ListCustomModelsOutcome(std::move(result.GetError())); } - ListEnforcedGuardrailsConfigurationOutcome BedrockClient::ListEnforcedGuardrailsConfiguration( const ListEnforcedGuardrailsConfigurationRequest& request) const { - AWS_OPERATION_GUARD(ListEnforcedGuardrailsConfiguration); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListEnforcedGuardrailsConfiguration, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListEnforcedGuardrailsConfiguration, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListEnforcedGuardrailsConfiguration, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListEnforcedGuardrailsConfiguration", - {{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( - [&]() -> ListEnforcedGuardrailsConfigurationOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/enforcedGuardrailsConfiguration"); - }); - return result.IsSuccess() ? ListEnforcedGuardrailsConfigurationOutcome(result.GetResultWithOwnership()) - : ListEnforcedGuardrailsConfigurationOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/enforcedGuardrailsConfiguration"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListEnforcedGuardrailsConfigurationOutcome(result.GetResultWithOwnership()) + : ListEnforcedGuardrailsConfigurationOutcome(std::move(result.GetError())); } - ListEvaluationJobsOutcome BedrockClient::ListEvaluationJobs(const ListEvaluationJobsRequest& request) const { - AWS_OPERATION_GUARD(ListEvaluationJobs); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListEvaluationJobs, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListEvaluationJobs, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListEvaluationJobs, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListEvaluationJobs", - {{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( - [&]() -> ListEvaluationJobsOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/evaluation-jobs"); }); - return result.IsSuccess() ? ListEvaluationJobsOutcome(result.GetResultWithOwnership()) - : ListEvaluationJobsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/evaluation-jobs"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListEvaluationJobsOutcome(result.GetResultWithOwnership()) + : ListEvaluationJobsOutcome(std::move(result.GetError())); } - ListFoundationModelAgreementOffersOutcome BedrockClient::ListFoundationModelAgreementOffers( const ListFoundationModelAgreementOffersRequest& request) const { - AWS_OPERATION_GUARD(ListFoundationModelAgreementOffers); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListFoundationModelAgreementOffers, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ModelIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("ListFoundationModelAgreementOffers", "Required field: ModelId, is not set"); return ListFoundationModelAgreementOffersOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ModelId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListFoundationModelAgreementOffers, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListFoundationModelAgreementOffers, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListFoundationModelAgreementOffers", - {{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( - [&]() -> ListFoundationModelAgreementOffersOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/list-foundation-model-agreement-offers/"); - resolvedEndpoint.AddPathSegment(request.GetModelId()); - }); - return result.IsSuccess() ? ListFoundationModelAgreementOffersOutcome(result.GetResultWithOwnership()) - : ListFoundationModelAgreementOffersOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/list-foundation-model-agreement-offers/"); + resolvedEndpoint.AddPathSegment(request.GetModelId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListFoundationModelAgreementOffersOutcome(result.GetResultWithOwnership()) + : ListFoundationModelAgreementOffersOutcome(std::move(result.GetError())); } - ListFoundationModelsOutcome BedrockClient::ListFoundationModels(const ListFoundationModelsRequest& request) const { - AWS_OPERATION_GUARD(ListFoundationModels); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListFoundationModels, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListFoundationModels, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListFoundationModels, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListFoundationModels", - {{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( - [&]() -> ListFoundationModelsOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/foundation-models"); }); - return result.IsSuccess() ? ListFoundationModelsOutcome(result.GetResultWithOwnership()) - : ListFoundationModelsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/foundation-models"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListFoundationModelsOutcome(result.GetResultWithOwnership()) + : ListFoundationModelsOutcome(std::move(result.GetError())); } - ListGuardrailsOutcome BedrockClient::ListGuardrails(const ListGuardrailsRequest& request) const { - AWS_OPERATION_GUARD(ListGuardrails); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListGuardrails, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListGuardrails, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListGuardrails, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListGuardrails", - {{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( - [&]() -> ListGuardrailsOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/guardrails"); }); - return result.IsSuccess() ? ListGuardrailsOutcome(result.GetResultWithOwnership()) - : ListGuardrailsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/guardrails"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListGuardrailsOutcome(result.GetResultWithOwnership()) : ListGuardrailsOutcome(std::move(result.GetError())); } - ListImportedModelsOutcome BedrockClient::ListImportedModels(const ListImportedModelsRequest& request) const { - AWS_OPERATION_GUARD(ListImportedModels); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListImportedModels, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListImportedModels, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListImportedModels, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListImportedModels", - {{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( - [&]() -> ListImportedModelsOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/imported-models"); }); - return result.IsSuccess() ? ListImportedModelsOutcome(result.GetResultWithOwnership()) - : ListImportedModelsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/imported-models"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListImportedModelsOutcome(result.GetResultWithOwnership()) + : ListImportedModelsOutcome(std::move(result.GetError())); } - ListInferenceProfilesOutcome BedrockClient::ListInferenceProfiles(const ListInferenceProfilesRequest& request) const { - AWS_OPERATION_GUARD(ListInferenceProfiles); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListInferenceProfiles, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListInferenceProfiles, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListInferenceProfiles, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListInferenceProfiles", - {{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( - [&]() -> ListInferenceProfilesOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/inference-profiles"); }); - return result.IsSuccess() ? ListInferenceProfilesOutcome(result.GetResultWithOwnership()) - : ListInferenceProfilesOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/inference-profiles"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListInferenceProfilesOutcome(result.GetResultWithOwnership()) + : ListInferenceProfilesOutcome(std::move(result.GetError())); } - ListMarketplaceModelEndpointsOutcome BedrockClient::ListMarketplaceModelEndpoints( const ListMarketplaceModelEndpointsRequest& request) const { - AWS_OPERATION_GUARD(ListMarketplaceModelEndpoints); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListMarketplaceModelEndpoints, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListMarketplaceModelEndpoints, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListMarketplaceModelEndpoints, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListMarketplaceModelEndpoints", - {{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( - [&]() -> ListMarketplaceModelEndpointsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/marketplace-model/endpoints"); - }); - return result.IsSuccess() ? ListMarketplaceModelEndpointsOutcome(result.GetResultWithOwnership()) - : ListMarketplaceModelEndpointsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/marketplace-model/endpoints"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListMarketplaceModelEndpointsOutcome(result.GetResultWithOwnership()) + : ListMarketplaceModelEndpointsOutcome(std::move(result.GetError())); } - ListModelCopyJobsOutcome BedrockClient::ListModelCopyJobs(const ListModelCopyJobsRequest& request) const { - AWS_OPERATION_GUARD(ListModelCopyJobs); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListModelCopyJobs, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListModelCopyJobs, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListModelCopyJobs, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListModelCopyJobs", - {{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( - [&]() -> ListModelCopyJobsOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/model-copy-jobs"); }); - return result.IsSuccess() ? ListModelCopyJobsOutcome(result.GetResultWithOwnership()) - : ListModelCopyJobsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/model-copy-jobs"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListModelCopyJobsOutcome(result.GetResultWithOwnership()) + : ListModelCopyJobsOutcome(std::move(result.GetError())); } - ListModelCustomizationJobsOutcome BedrockClient::ListModelCustomizationJobs(const ListModelCustomizationJobsRequest& request) const { - AWS_OPERATION_GUARD(ListModelCustomizationJobs); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListModelCustomizationJobs, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListModelCustomizationJobs, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListModelCustomizationJobs, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListModelCustomizationJobs", - {{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( - [&]() -> ListModelCustomizationJobsOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/model-customization-jobs"); }); - return result.IsSuccess() ? ListModelCustomizationJobsOutcome(result.GetResultWithOwnership()) - : ListModelCustomizationJobsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/model-customization-jobs"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListModelCustomizationJobsOutcome(result.GetResultWithOwnership()) + : ListModelCustomizationJobsOutcome(std::move(result.GetError())); } - ListModelImportJobsOutcome BedrockClient::ListModelImportJobs(const ListModelImportJobsRequest& request) const { - AWS_OPERATION_GUARD(ListModelImportJobs); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListModelImportJobs, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListModelImportJobs, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListModelImportJobs, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListModelImportJobs", - {{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( - [&]() -> ListModelImportJobsOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/model-import-jobs"); }); - return result.IsSuccess() ? ListModelImportJobsOutcome(result.GetResultWithOwnership()) - : ListModelImportJobsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/model-import-jobs"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListModelImportJobsOutcome(result.GetResultWithOwnership()) + : ListModelImportJobsOutcome(std::move(result.GetError())); } - ListModelInvocationJobsOutcome BedrockClient::ListModelInvocationJobs(const ListModelInvocationJobsRequest& request) const { - AWS_OPERATION_GUARD(ListModelInvocationJobs); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListModelInvocationJobs, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListModelInvocationJobs, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListModelInvocationJobs, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListModelInvocationJobs", - {{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( - [&]() -> ListModelInvocationJobsOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/model-invocation-jobs"); }); - return result.IsSuccess() ? ListModelInvocationJobsOutcome(result.GetResultWithOwnership()) - : ListModelInvocationJobsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/model-invocation-jobs"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListModelInvocationJobsOutcome(result.GetResultWithOwnership()) + : ListModelInvocationJobsOutcome(std::move(result.GetError())); } - ListPromptRoutersOutcome BedrockClient::ListPromptRouters(const ListPromptRoutersRequest& request) const { - AWS_OPERATION_GUARD(ListPromptRouters); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListPromptRouters, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListPromptRouters, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListPromptRouters, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListPromptRouters", - {{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( - [&]() -> ListPromptRoutersOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/prompt-routers"); }); - return result.IsSuccess() ? ListPromptRoutersOutcome(result.GetResultWithOwnership()) - : ListPromptRoutersOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/prompt-routers"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListPromptRoutersOutcome(result.GetResultWithOwnership()) + : ListPromptRoutersOutcome(std::move(result.GetError())); } - ListProvisionedModelThroughputsOutcome BedrockClient::ListProvisionedModelThroughputs( const ListProvisionedModelThroughputsRequest& request) const { - AWS_OPERATION_GUARD(ListProvisionedModelThroughputs); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListProvisionedModelThroughputs, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListProvisionedModelThroughputs, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListProvisionedModelThroughputs, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListProvisionedModelThroughputs", - {{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( - [&]() -> ListProvisionedModelThroughputsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_GET, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/provisioned-model-throughputs"); - }); - return result.IsSuccess() ? ListProvisionedModelThroughputsOutcome(result.GetResultWithOwnership()) - : ListProvisionedModelThroughputsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/provisioned-model-throughputs"); }, + Aws::Http::HttpMethod::HTTP_GET); + return result.IsSuccess() ? ListProvisionedModelThroughputsOutcome(result.GetResultWithOwnership()) + : ListProvisionedModelThroughputsOutcome(std::move(result.GetError())); } - ListTagsForResourceOutcome BedrockClient::ListTagsForResource(const ListTagsForResourceRequest& request) const { - AWS_OPERATION_GUARD(ListTagsForResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListTagsForResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListTagsForResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListTagsForResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListTagsForResource", - {{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( - [&]() -> ListTagsForResourceOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/listTagsForResource"); }); - return result.IsSuccess() ? ListTagsForResourceOutcome(result.GetResultWithOwnership()) - : ListTagsForResourceOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/listTagsForResource"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListTagsForResourceOutcome(result.GetResultWithOwnership()) + : ListTagsForResourceOutcome(std::move(result.GetError())); } - PutEnforcedGuardrailConfigurationOutcome BedrockClient::PutEnforcedGuardrailConfiguration( const PutEnforcedGuardrailConfigurationRequest& request) const { - AWS_OPERATION_GUARD(PutEnforcedGuardrailConfiguration); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, PutEnforcedGuardrailConfiguration, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, PutEnforcedGuardrailConfiguration, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, PutEnforcedGuardrailConfiguration, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".PutEnforcedGuardrailConfiguration", - {{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( - [&]() -> PutEnforcedGuardrailConfigurationOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/enforcedGuardrailsConfiguration"); - }); - return result.IsSuccess() ? PutEnforcedGuardrailConfigurationOutcome(result.GetResultWithOwnership()) - : PutEnforcedGuardrailConfigurationOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/enforcedGuardrailsConfiguration"); }, + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? PutEnforcedGuardrailConfigurationOutcome(result.GetResultWithOwnership()) + : PutEnforcedGuardrailConfigurationOutcome(std::move(result.GetError())); } - PutModelInvocationLoggingConfigurationOutcome BedrockClient::PutModelInvocationLoggingConfiguration( const PutModelInvocationLoggingConfigurationRequest& request) const { - AWS_OPERATION_GUARD(PutModelInvocationLoggingConfiguration); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, PutModelInvocationLoggingConfiguration, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, PutModelInvocationLoggingConfiguration, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, PutModelInvocationLoggingConfiguration, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".PutModelInvocationLoggingConfiguration", - {{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( - [&]() -> PutModelInvocationLoggingConfigurationOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/logging/modelinvocations"); }); - return result.IsSuccess() ? PutModelInvocationLoggingConfigurationOutcome(result.GetResultWithOwnership()) - : PutModelInvocationLoggingConfigurationOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/logging/modelinvocations"); }, + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? PutModelInvocationLoggingConfigurationOutcome(result.GetResultWithOwnership()) + : PutModelInvocationLoggingConfigurationOutcome(std::move(result.GetError())); } - PutResourcePolicyOutcome BedrockClient::PutResourcePolicy(const PutResourcePolicyRequest& request) const { - AWS_OPERATION_GUARD(PutResourcePolicy); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, PutResourcePolicy, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, PutResourcePolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, PutResourcePolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".PutResourcePolicy", - {{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( - [&]() -> PutResourcePolicyOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/resource-policy"); }); - return result.IsSuccess() ? PutResourcePolicyOutcome(result.GetResultWithOwnership()) - : PutResourcePolicyOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/resource-policy"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? PutResourcePolicyOutcome(result.GetResultWithOwnership()) + : PutResourcePolicyOutcome(std::move(result.GetError())); } - PutUseCaseForModelAccessOutcome BedrockClient::PutUseCaseForModelAccess(const PutUseCaseForModelAccessRequest& request) const { - AWS_OPERATION_GUARD(PutUseCaseForModelAccess); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, PutUseCaseForModelAccess, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, PutUseCaseForModelAccess, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, PutUseCaseForModelAccess, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".PutUseCaseForModelAccess", - {{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( - [&]() -> PutUseCaseForModelAccessOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/use-case-for-model-access"); }); - return result.IsSuccess() ? PutUseCaseForModelAccessOutcome(result.GetResultWithOwnership()) - : PutUseCaseForModelAccessOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/use-case-for-model-access"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? PutUseCaseForModelAccessOutcome(result.GetResultWithOwnership()) + : PutUseCaseForModelAccessOutcome(std::move(result.GetError())); } - RegisterMarketplaceModelEndpointOutcome BedrockClient::RegisterMarketplaceModelEndpoint( const RegisterMarketplaceModelEndpointRequest& request) const { - AWS_OPERATION_GUARD(RegisterMarketplaceModelEndpoint); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, RegisterMarketplaceModelEndpoint, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.EndpointIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("RegisterMarketplaceModelEndpoint", "Required field: EndpointIdentifier, is not set"); return RegisterMarketplaceModelEndpointOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [EndpointIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, RegisterMarketplaceModelEndpoint, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, RegisterMarketplaceModelEndpoint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".RegisterMarketplaceModelEndpoint", - {{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( - [&]() -> RegisterMarketplaceModelEndpointOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/marketplace-model/endpoints/"); - resolvedEndpoint.AddPathSegment(request.GetEndpointIdentifier()); - resolvedEndpoint.AddPathSegments("/registration"); - }); - return result.IsSuccess() ? RegisterMarketplaceModelEndpointOutcome(result.GetResultWithOwnership()) - : RegisterMarketplaceModelEndpointOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/marketplace-model/endpoints/"); + resolvedEndpoint.AddPathSegment(request.GetEndpointIdentifier()); + resolvedEndpoint.AddPathSegments("/registration"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? RegisterMarketplaceModelEndpointOutcome(result.GetResultWithOwnership()) + : RegisterMarketplaceModelEndpointOutcome(std::move(result.GetError())); } - StartAutomatedReasoningPolicyBuildWorkflowOutcome BedrockClient::StartAutomatedReasoningPolicyBuildWorkflow( const StartAutomatedReasoningPolicyBuildWorkflowRequest& request) const { - AWS_OPERATION_GUARD(StartAutomatedReasoningPolicyBuildWorkflow); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, StartAutomatedReasoningPolicyBuildWorkflow, CoreErrors, - CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("StartAutomatedReasoningPolicyBuildWorkflow", "Required field: PolicyArn, is not set"); return StartAutomatedReasoningPolicyBuildWorkflowOutcome(Aws::Client::AWSError( @@ -2976,42 +1537,24 @@ StartAutomatedReasoningPolicyBuildWorkflowOutcome BedrockClient::StartAutomatedR return StartAutomatedReasoningPolicyBuildWorkflowOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [BuildWorkflowType]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, StartAutomatedReasoningPolicyBuildWorkflow, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, StartAutomatedReasoningPolicyBuildWorkflow, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".StartAutomatedReasoningPolicyBuildWorkflow", - {{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( - [&]() -> StartAutomatedReasoningPolicyBuildWorkflowOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/build-workflows/"); - resolvedEndpoint.AddPathSegment( - AutomatedReasoningPolicyBuildWorkflowTypeMapper::GetNameForAutomatedReasoningPolicyBuildWorkflowType( - request.GetBuildWorkflowType())); - resolvedEndpoint.AddPathSegments("/start"); - }); - return result.IsSuccess() ? StartAutomatedReasoningPolicyBuildWorkflowOutcome(result.GetResultWithOwnership()) - : StartAutomatedReasoningPolicyBuildWorkflowOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/build-workflows/"); + resolvedEndpoint.AddPathSegment( + AutomatedReasoningPolicyBuildWorkflowTypeMapper::GetNameForAutomatedReasoningPolicyBuildWorkflowType( + request.GetBuildWorkflowType())); + resolvedEndpoint.AddPathSegments("/start"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? StartAutomatedReasoningPolicyBuildWorkflowOutcome(result.GetResultWithOwnership()) + : StartAutomatedReasoningPolicyBuildWorkflowOutcome(std::move(result.GetError())); } - StartAutomatedReasoningPolicyTestWorkflowOutcome BedrockClient::StartAutomatedReasoningPolicyTestWorkflow( const StartAutomatedReasoningPolicyTestWorkflowRequest& request) const { - AWS_OPERATION_GUARD(StartAutomatedReasoningPolicyTestWorkflow); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, StartAutomatedReasoningPolicyTestWorkflow, CoreErrors, - CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("StartAutomatedReasoningPolicyTestWorkflow", "Required field: PolicyArn, is not set"); return StartAutomatedReasoningPolicyTestWorkflowOutcome(Aws::Client::AWSError( @@ -3022,220 +1565,106 @@ StartAutomatedReasoningPolicyTestWorkflowOutcome BedrockClient::StartAutomatedRe return StartAutomatedReasoningPolicyTestWorkflowOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [BuildWorkflowId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, StartAutomatedReasoningPolicyTestWorkflow, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, StartAutomatedReasoningPolicyTestWorkflow, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".StartAutomatedReasoningPolicyTestWorkflow", - {{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( - [&]() -> StartAutomatedReasoningPolicyTestWorkflowOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/build-workflows/"); - resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); - resolvedEndpoint.AddPathSegments("/test-workflows"); - }); - return result.IsSuccess() ? StartAutomatedReasoningPolicyTestWorkflowOutcome(result.GetResultWithOwnership()) - : StartAutomatedReasoningPolicyTestWorkflowOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/build-workflows/"); + resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); + resolvedEndpoint.AddPathSegments("/test-workflows"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? StartAutomatedReasoningPolicyTestWorkflowOutcome(result.GetResultWithOwnership()) + : StartAutomatedReasoningPolicyTestWorkflowOutcome(std::move(result.GetError())); } - StopEvaluationJobOutcome BedrockClient::StopEvaluationJob(const StopEvaluationJobRequest& request) const { - AWS_OPERATION_GUARD(StopEvaluationJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, StopEvaluationJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.JobIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("StopEvaluationJob", "Required field: JobIdentifier, is not set"); return StopEvaluationJobOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [JobIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, StopEvaluationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, StopEvaluationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".StopEvaluationJob", - {{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( - [&]() -> StopEvaluationJobOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/evaluation-job/"); - resolvedEndpoint.AddPathSegment(request.GetJobIdentifier()); - resolvedEndpoint.AddPathSegments("/stop"); - }); - return result.IsSuccess() ? StopEvaluationJobOutcome(result.GetResultWithOwnership()) - : StopEvaluationJobOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/evaluation-job/"); + resolvedEndpoint.AddPathSegment(request.GetJobIdentifier()); + resolvedEndpoint.AddPathSegments("/stop"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? StopEvaluationJobOutcome(result.GetResultWithOwnership()) + : StopEvaluationJobOutcome(std::move(result.GetError())); } - StopModelCustomizationJobOutcome BedrockClient::StopModelCustomizationJob(const StopModelCustomizationJobRequest& request) const { - AWS_OPERATION_GUARD(StopModelCustomizationJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, StopModelCustomizationJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.JobIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("StopModelCustomizationJob", "Required field: JobIdentifier, is not set"); return StopModelCustomizationJobOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [JobIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, StopModelCustomizationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, StopModelCustomizationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".StopModelCustomizationJob", - {{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( - [&]() -> StopModelCustomizationJobOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/model-customization-jobs/"); - resolvedEndpoint.AddPathSegment(request.GetJobIdentifier()); - resolvedEndpoint.AddPathSegments("/stop"); - }); - return result.IsSuccess() ? StopModelCustomizationJobOutcome(result.GetResultWithOwnership()) - : StopModelCustomizationJobOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/model-customization-jobs/"); + resolvedEndpoint.AddPathSegment(request.GetJobIdentifier()); + resolvedEndpoint.AddPathSegments("/stop"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? StopModelCustomizationJobOutcome(result.GetResultWithOwnership()) + : StopModelCustomizationJobOutcome(std::move(result.GetError())); } - StopModelInvocationJobOutcome BedrockClient::StopModelInvocationJob(const StopModelInvocationJobRequest& request) const { - AWS_OPERATION_GUARD(StopModelInvocationJob); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, StopModelInvocationJob, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.JobIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("StopModelInvocationJob", "Required field: JobIdentifier, is not set"); return StopModelInvocationJobOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [JobIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, StopModelInvocationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, StopModelInvocationJob, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".StopModelInvocationJob", - {{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( - [&]() -> StopModelInvocationJobOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/model-invocation-job/"); - resolvedEndpoint.AddPathSegment(request.GetJobIdentifier()); - resolvedEndpoint.AddPathSegments("/stop"); - }); - return result.IsSuccess() ? StopModelInvocationJobOutcome(result.GetResultWithOwnership()) - : StopModelInvocationJobOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/model-invocation-job/"); + resolvedEndpoint.AddPathSegment(request.GetJobIdentifier()); + resolvedEndpoint.AddPathSegments("/stop"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? StopModelInvocationJobOutcome(result.GetResultWithOwnership()) + : StopModelInvocationJobOutcome(std::move(result.GetError())); } - TagResourceOutcome BedrockClient::TagResource(const TagResourceRequest& request) const { - AWS_OPERATION_GUARD(TagResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, TagResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, TagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, TagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".TagResource", - {{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( - [&]() -> TagResourceOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/tagResource"); }); - return result.IsSuccess() ? TagResourceOutcome(result.GetResultWithOwnership()) : TagResourceOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/tagResource"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? TagResourceOutcome(result.GetResultWithOwnership()) : TagResourceOutcome(std::move(result.GetError())); } - UntagResourceOutcome BedrockClient::UntagResource(const UntagResourceRequest& request) const { - AWS_OPERATION_GUARD(UntagResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UntagResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UntagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UntagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UntagResource", - {{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( - [&]() -> UntagResourceOutcome { - auto result = MakeRequestDeserialize( - &request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { resolvedEndpoint.AddPathSegments("/untagResource"); }); - return result.IsSuccess() ? UntagResourceOutcome(result.GetResultWithOwnership()) - : UntagResourceOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation( + request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { resolvedEndpoint.AddPathSegments("/untagResource"); }, + Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? UntagResourceOutcome(result.GetResultWithOwnership()) : UntagResourceOutcome(std::move(result.GetError())); } - UpdateAutomatedReasoningPolicyOutcome BedrockClient::UpdateAutomatedReasoningPolicy( const UpdateAutomatedReasoningPolicyRequest& request) const { - AWS_OPERATION_GUARD(UpdateAutomatedReasoningPolicy); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateAutomatedReasoningPolicy, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateAutomatedReasoningPolicy", "Required field: PolicyArn, is not set"); return UpdateAutomatedReasoningPolicyOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [PolicyArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateAutomatedReasoningPolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateAutomatedReasoningPolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateAutomatedReasoningPolicy", - {{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( - [&]() -> UpdateAutomatedReasoningPolicyOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PATCH, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - }); - return result.IsSuccess() ? UpdateAutomatedReasoningPolicyOutcome(result.GetResultWithOwnership()) - : UpdateAutomatedReasoningPolicyOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PATCH); + return result.IsSuccess() ? UpdateAutomatedReasoningPolicyOutcome(result.GetResultWithOwnership()) + : UpdateAutomatedReasoningPolicyOutcome(std::move(result.GetError())); } - UpdateAutomatedReasoningPolicyAnnotationsOutcome BedrockClient::UpdateAutomatedReasoningPolicyAnnotations( const UpdateAutomatedReasoningPolicyAnnotationsRequest& request) const { - AWS_OPERATION_GUARD(UpdateAutomatedReasoningPolicyAnnotations); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateAutomatedReasoningPolicyAnnotations, CoreErrors, - CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateAutomatedReasoningPolicyAnnotations", "Required field: PolicyArn, is not set"); return UpdateAutomatedReasoningPolicyAnnotationsOutcome(Aws::Client::AWSError( @@ -3246,38 +1675,22 @@ UpdateAutomatedReasoningPolicyAnnotationsOutcome BedrockClient::UpdateAutomatedR return UpdateAutomatedReasoningPolicyAnnotationsOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [BuildWorkflowId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateAutomatedReasoningPolicyAnnotations, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateAutomatedReasoningPolicyAnnotations, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateAutomatedReasoningPolicyAnnotations", - {{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( - [&]() -> UpdateAutomatedReasoningPolicyAnnotationsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PATCH, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/build-workflows/"); - resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); - resolvedEndpoint.AddPathSegments("/annotations"); - }); - return result.IsSuccess() ? UpdateAutomatedReasoningPolicyAnnotationsOutcome(result.GetResultWithOwnership()) - : UpdateAutomatedReasoningPolicyAnnotationsOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/build-workflows/"); + resolvedEndpoint.AddPathSegment(request.GetBuildWorkflowId()); + resolvedEndpoint.AddPathSegments("/annotations"); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PATCH); + return result.IsSuccess() ? UpdateAutomatedReasoningPolicyAnnotationsOutcome(result.GetResultWithOwnership()) + : UpdateAutomatedReasoningPolicyAnnotationsOutcome(std::move(result.GetError())); } - UpdateAutomatedReasoningPolicyTestCaseOutcome BedrockClient::UpdateAutomatedReasoningPolicyTestCase( const UpdateAutomatedReasoningPolicyTestCaseRequest& request) const { - AWS_OPERATION_GUARD(UpdateAutomatedReasoningPolicyTestCase); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateAutomatedReasoningPolicyTestCase, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.PolicyArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateAutomatedReasoningPolicyTestCase", "Required field: PolicyArn, is not set"); return UpdateAutomatedReasoningPolicyTestCaseOutcome(Aws::Client::AWSError( @@ -3288,160 +1701,86 @@ UpdateAutomatedReasoningPolicyTestCaseOutcome BedrockClient::UpdateAutomatedReas return UpdateAutomatedReasoningPolicyTestCaseOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [TestCaseId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateAutomatedReasoningPolicyTestCase, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateAutomatedReasoningPolicyTestCase, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateAutomatedReasoningPolicyTestCase", - {{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( - [&]() -> UpdateAutomatedReasoningPolicyTestCaseOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PATCH, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); - resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); - resolvedEndpoint.AddPathSegments("/test-cases/"); - resolvedEndpoint.AddPathSegment(request.GetTestCaseId()); - }); - return result.IsSuccess() ? UpdateAutomatedReasoningPolicyTestCaseOutcome(result.GetResultWithOwnership()) - : UpdateAutomatedReasoningPolicyTestCaseOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/automated-reasoning-policies/"); + resolvedEndpoint.AddPathSegment(request.GetPolicyArn()); + resolvedEndpoint.AddPathSegments("/test-cases/"); + resolvedEndpoint.AddPathSegment(request.GetTestCaseId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PATCH); + return result.IsSuccess() ? UpdateAutomatedReasoningPolicyTestCaseOutcome(result.GetResultWithOwnership()) + : UpdateAutomatedReasoningPolicyTestCaseOutcome(std::move(result.GetError())); } - UpdateCustomModelDeploymentOutcome BedrockClient::UpdateCustomModelDeployment(const UpdateCustomModelDeploymentRequest& request) const { - AWS_OPERATION_GUARD(UpdateCustomModelDeployment); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateCustomModelDeployment, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.CustomModelDeploymentIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateCustomModelDeployment", "Required field: CustomModelDeploymentIdentifier, is not set"); return UpdateCustomModelDeploymentOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [CustomModelDeploymentIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateCustomModelDeployment, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateCustomModelDeployment, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateCustomModelDeployment", - {{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( - [&]() -> UpdateCustomModelDeploymentOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PATCH, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/model-customization/custom-model-deployments/"); - resolvedEndpoint.AddPathSegment(request.GetCustomModelDeploymentIdentifier()); - }); - return result.IsSuccess() ? UpdateCustomModelDeploymentOutcome(result.GetResultWithOwnership()) - : UpdateCustomModelDeploymentOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/model-customization/custom-model-deployments/"); + resolvedEndpoint.AddPathSegment(request.GetCustomModelDeploymentIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PATCH); + return result.IsSuccess() ? UpdateCustomModelDeploymentOutcome(result.GetResultWithOwnership()) + : UpdateCustomModelDeploymentOutcome(std::move(result.GetError())); } - UpdateGuardrailOutcome BedrockClient::UpdateGuardrail(const UpdateGuardrailRequest& request) const { - AWS_OPERATION_GUARD(UpdateGuardrail); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateGuardrail, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.GuardrailIdentifierHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateGuardrail", "Required field: GuardrailIdentifier, is not set"); return UpdateGuardrailOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [GuardrailIdentifier]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateGuardrail, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateGuardrail, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateGuardrail", - {{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( - [&]() -> UpdateGuardrailOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PUT, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/guardrails/"); - resolvedEndpoint.AddPathSegment(request.GetGuardrailIdentifier()); - }); - return result.IsSuccess() ? UpdateGuardrailOutcome(result.GetResultWithOwnership()) - : UpdateGuardrailOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/guardrails/"); + resolvedEndpoint.AddPathSegment(request.GetGuardrailIdentifier()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PUT); + return result.IsSuccess() ? UpdateGuardrailOutcome(result.GetResultWithOwnership()) + : UpdateGuardrailOutcome(std::move(result.GetError())); } - UpdateMarketplaceModelEndpointOutcome BedrockClient::UpdateMarketplaceModelEndpoint( const UpdateMarketplaceModelEndpointRequest& request) const { - AWS_OPERATION_GUARD(UpdateMarketplaceModelEndpoint); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateMarketplaceModelEndpoint, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.EndpointArnHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateMarketplaceModelEndpoint", "Required field: EndpointArn, is not set"); return UpdateMarketplaceModelEndpointOutcome(Aws::Client::AWSError(BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [EndpointArn]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateMarketplaceModelEndpoint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateMarketplaceModelEndpoint, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateMarketplaceModelEndpoint", - {{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( - [&]() -> UpdateMarketplaceModelEndpointOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PATCH, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/marketplace-model/endpoints/"); - resolvedEndpoint.AddPathSegment(request.GetEndpointArn()); - }); - return result.IsSuccess() ? UpdateMarketplaceModelEndpointOutcome(result.GetResultWithOwnership()) - : UpdateMarketplaceModelEndpointOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/marketplace-model/endpoints/"); + resolvedEndpoint.AddPathSegment(request.GetEndpointArn()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PATCH); + return result.IsSuccess() ? UpdateMarketplaceModelEndpointOutcome(result.GetResultWithOwnership()) + : UpdateMarketplaceModelEndpointOutcome(std::move(result.GetError())); } - UpdateProvisionedModelThroughputOutcome BedrockClient::UpdateProvisionedModelThroughput( const UpdateProvisionedModelThroughputRequest& request) const { - AWS_OPERATION_GUARD(UpdateProvisionedModelThroughput); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateProvisionedModelThroughput, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); if (!request.ProvisionedModelIdHasBeenSet()) { AWS_LOGSTREAM_ERROR("UpdateProvisionedModelThroughput", "Required field: ProvisionedModelId, is not set"); return UpdateProvisionedModelThroughputOutcome(Aws::Client::AWSError( BedrockErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ProvisionedModelId]", false)); } - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateProvisionedModelThroughput, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateProvisionedModelThroughput, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateProvisionedModelThroughput", - {{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( - [&]() -> UpdateProvisionedModelThroughputOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_PATCH, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - resolvedEndpoint.AddPathSegments("/provisioned-model-throughput/"); - resolvedEndpoint.AddPathSegment(request.GetProvisionedModelId()); - }); - return result.IsSuccess() ? UpdateProvisionedModelThroughputOutcome(result.GetResultWithOwnership()) - : UpdateProvisionedModelThroughputOutcome(std::move(result.GetError())); + + auto result = InvokeServiceOperation( + request, + [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { + resolvedEndpoint.AddPathSegments("/provisioned-model-throughput/"); + resolvedEndpoint.AddPathSegment(request.GetProvisionedModelId()); }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + Aws::Http::HttpMethod::HTTP_PATCH); + return result.IsSuccess() ? UpdateProvisionedModelThroughputOutcome(result.GetResultWithOwnership()) + : UpdateProvisionedModelThroughputOutcome(std::move(result.GetError())); } diff --git a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/DynamoDBClient.h b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/DynamoDBClient.h index 1db83c015480..f5b055f60e26 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/DynamoDBClient.h +++ b/generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/DynamoDBClient.h @@ -2352,6 +2352,10 @@ class AWS_DYNAMODB_API DynamoDBClient private: friend class Aws::Client::ClientWithAsyncTemplateMethods; + typedef Aws::Utils::Outcome, DynamoDBError> InvokeOperationOutcome; + + InvokeOperationOutcome InvokeServiceOperation(const AmazonWebServiceRequest& request, Aws::Http::HttpMethod httpMethod) const; + void OptionallyUpdateDescribeEndpointsCache(Aws::Endpoint::AWSEndpoint& resolvedEndpoint, const Aws::String& operationName, const Aws::String& endpointKey, const Aws::DynamoDB::Model::DescribeEndpointsRequest& endpointRequest, diff --git a/generated/src/aws-cpp-sdk-dynamodb/source/DynamoDBClient.cpp b/generated/src/aws-cpp-sdk-dynamodb/source/DynamoDBClient.cpp index fe1d4f17f0e5..04cd012d14a6 100644 --- a/generated/src/aws-cpp-sdk-dynamodb/source/DynamoDBClient.cpp +++ b/generated/src/aws-cpp-sdk-dynamodb/source/DynamoDBClient.cpp @@ -188,1593 +188,301 @@ void DynamoDBClient::OverrideEndpoint(const Aws::String& endpoint) { m_clientConfiguration.endpointOverride = endpoint; m_endpointProvider->OverrideEndpoint(endpoint); } -BatchExecuteStatementOutcome DynamoDBClient::BatchExecuteStatement(const BatchExecuteStatementRequest& request) const { - AWS_OPERATION_GUARD(BatchExecuteStatement); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, BatchExecuteStatement, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, BatchExecuteStatement, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, BatchExecuteStatement, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".BatchExecuteStatement", - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}, +DynamoDBClient::InvokeOperationOutcome DynamoDBClient::InvokeServiceOperation(const AmazonWebServiceRequest& request, + Aws::Http::HttpMethod httpMethod) const { + auto operationName = request.GetServiceRequestName(); + auto serviceName = GetServiceClientName(); + + AWS_OPERATION_GUARD_DYNAMIC(operationName); + + AWS_OPERATION_CHECK_PTR_DYNAMIC(m_clientConfiguration.telemetryProvider, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto tracer = m_clientConfiguration.telemetryProvider->getTracer(serviceName, {}); + auto meter = m_clientConfiguration.telemetryProvider->getMeter(serviceName, {}); + AWS_OPERATION_CHECK_PTR_DYNAMIC(meter, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto span = tracer->CreateSpan(Aws::String(serviceName) + "." + operationName, + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, + {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}, {TracingUtils::SMITHY_SYSTEM_DIMENSION, TracingUtils::SMITHY_METHOD_AWS_VALUE}}, smithy::components::tracing::SpanKind::CLIENT); - return TracingUtils::MakeCallWithTiming( - [&]() -> BatchExecuteStatementOutcome { + + return TracingUtils::MakeCallWithTiming( + [&]() -> InvokeOperationOutcome { auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, + MakeRequestDeserialize(&request, operationName, httpMethod, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? BatchExecuteStatementOutcome(result.GetResultWithOwnership()) - : BatchExecuteStatementOutcome(std::move(result.GetError())); + return result.IsSuccess() ? InvokeOperationOutcome(result.GetResultWithOwnership()) + : InvokeOperationOutcome(std::move(result.GetError())); }, TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}}); +} +BatchExecuteStatementOutcome DynamoDBClient::BatchExecuteStatement(const BatchExecuteStatementRequest& request) const { + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? BatchExecuteStatementOutcome(result.GetResultWithOwnership()) + : BatchExecuteStatementOutcome(std::move(result.GetError())); } - BatchGetItemOutcome DynamoDBClient::BatchGetItem(const BatchGetItemRequest& request) const { - AWS_OPERATION_GUARD(BatchGetItem); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, BatchGetItem, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, BatchGetItem, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, BatchGetItem, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".BatchGetItem", - {{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( - [&]() -> BatchGetItemOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? BatchGetItemOutcome(result.GetResultWithOwnership()) - : BatchGetItemOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? BatchGetItemOutcome(result.GetResultWithOwnership()) : BatchGetItemOutcome(std::move(result.GetError())); } - BatchWriteItemOutcome DynamoDBClient::BatchWriteItem(const BatchWriteItemRequest& request) const { - AWS_OPERATION_GUARD(BatchWriteItem); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, BatchWriteItem, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, BatchWriteItem, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, BatchWriteItem, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".BatchWriteItem", - {{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( - [&]() -> BatchWriteItemOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? BatchWriteItemOutcome(result.GetResultWithOwnership()) - : BatchWriteItemOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? BatchWriteItemOutcome(result.GetResultWithOwnership()) : BatchWriteItemOutcome(std::move(result.GetError())); } - CreateBackupOutcome DynamoDBClient::CreateBackup(const CreateBackupRequest& request) const { - AWS_OPERATION_GUARD(CreateBackup); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateBackup, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateBackup, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateBackup, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateBackup", - {{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( - [&]() -> CreateBackupOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? CreateBackupOutcome(result.GetResultWithOwnership()) - : CreateBackupOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateBackupOutcome(result.GetResultWithOwnership()) : CreateBackupOutcome(std::move(result.GetError())); } - CreateGlobalTableOutcome DynamoDBClient::CreateGlobalTable(const CreateGlobalTableRequest& request) const { - AWS_OPERATION_GUARD(CreateGlobalTable); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateGlobalTable, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateGlobalTable, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateGlobalTable, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateGlobalTable", - {{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( - [&]() -> CreateGlobalTableOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? CreateGlobalTableOutcome(result.GetResultWithOwnership()) - : CreateGlobalTableOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateGlobalTableOutcome(result.GetResultWithOwnership()) + : CreateGlobalTableOutcome(std::move(result.GetError())); } - CreateTableOutcome DynamoDBClient::CreateTable(const CreateTableRequest& request) const { - AWS_OPERATION_GUARD(CreateTable); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, CreateTable, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, CreateTable, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, CreateTable, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".CreateTable", - {{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( - [&]() -> CreateTableOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? CreateTableOutcome(result.GetResultWithOwnership()) : CreateTableOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? CreateTableOutcome(result.GetResultWithOwnership()) : CreateTableOutcome(std::move(result.GetError())); } - DeleteBackupOutcome DynamoDBClient::DeleteBackup(const DeleteBackupRequest& request) const { - AWS_OPERATION_GUARD(DeleteBackup); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteBackup, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteBackup, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteBackup, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteBackup", - {{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( - [&]() -> DeleteBackupOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? DeleteBackupOutcome(result.GetResultWithOwnership()) - : DeleteBackupOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DeleteBackupOutcome(result.GetResultWithOwnership()) : DeleteBackupOutcome(std::move(result.GetError())); } - DeleteItemOutcome DynamoDBClient::DeleteItem(const DeleteItemRequest& request) const { - AWS_OPERATION_GUARD(DeleteItem); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteItem, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteItem, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteItem, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteItem", - {{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( - [&]() -> DeleteItemOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? DeleteItemOutcome(result.GetResultWithOwnership()) : DeleteItemOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DeleteItemOutcome(result.GetResultWithOwnership()) : DeleteItemOutcome(std::move(result.GetError())); } - DeleteResourcePolicyOutcome DynamoDBClient::DeleteResourcePolicy(const DeleteResourcePolicyRequest& request) const { - AWS_OPERATION_GUARD(DeleteResourcePolicy); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteResourcePolicy, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteResourcePolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteResourcePolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteResourcePolicy", - {{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( - [&]() -> DeleteResourcePolicyOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? DeleteResourcePolicyOutcome(result.GetResultWithOwnership()) - : DeleteResourcePolicyOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DeleteResourcePolicyOutcome(result.GetResultWithOwnership()) + : DeleteResourcePolicyOutcome(std::move(result.GetError())); } - DeleteTableOutcome DynamoDBClient::DeleteTable(const DeleteTableRequest& request) const { - AWS_OPERATION_GUARD(DeleteTable); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DeleteTable, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DeleteTable, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DeleteTable, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DeleteTable", - {{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( - [&]() -> DeleteTableOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? DeleteTableOutcome(result.GetResultWithOwnership()) : DeleteTableOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DeleteTableOutcome(result.GetResultWithOwnership()) : DeleteTableOutcome(std::move(result.GetError())); } - DescribeBackupOutcome DynamoDBClient::DescribeBackup(const DescribeBackupRequest& request) const { - AWS_OPERATION_GUARD(DescribeBackup); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DescribeBackup, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DescribeBackup, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DescribeBackup, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DescribeBackup", - {{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( - [&]() -> DescribeBackupOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? DescribeBackupOutcome(result.GetResultWithOwnership()) - : DescribeBackupOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DescribeBackupOutcome(result.GetResultWithOwnership()) : DescribeBackupOutcome(std::move(result.GetError())); } - DescribeContinuousBackupsOutcome DynamoDBClient::DescribeContinuousBackups(const DescribeContinuousBackupsRequest& request) const { - AWS_OPERATION_GUARD(DescribeContinuousBackups); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DescribeContinuousBackups, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DescribeContinuousBackups, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DescribeContinuousBackups, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DescribeContinuousBackups", - {{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( - [&]() -> DescribeContinuousBackupsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? DescribeContinuousBackupsOutcome(result.GetResultWithOwnership()) - : DescribeContinuousBackupsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DescribeContinuousBackupsOutcome(result.GetResultWithOwnership()) + : DescribeContinuousBackupsOutcome(std::move(result.GetError())); } - DescribeContributorInsightsOutcome DynamoDBClient::DescribeContributorInsights(const DescribeContributorInsightsRequest& request) const { - AWS_OPERATION_GUARD(DescribeContributorInsights); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DescribeContributorInsights, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DescribeContributorInsights, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DescribeContributorInsights, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DescribeContributorInsights", - {{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( - [&]() -> DescribeContributorInsightsOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? DescribeContributorInsightsOutcome(result.GetResultWithOwnership()) - : DescribeContributorInsightsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DescribeContributorInsightsOutcome(result.GetResultWithOwnership()) + : DescribeContributorInsightsOutcome(std::move(result.GetError())); } - DescribeEndpointsOutcome DynamoDBClient::DescribeEndpoints(const DescribeEndpointsRequest& request) const { - AWS_OPERATION_GUARD(DescribeEndpoints); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DescribeEndpoints, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DescribeEndpoints, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DescribeEndpoints, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DescribeEndpoints", - {{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( - [&]() -> DescribeEndpointsOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? DescribeEndpointsOutcome(result.GetResultWithOwnership()) - : DescribeEndpointsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DescribeEndpointsOutcome(result.GetResultWithOwnership()) + : DescribeEndpointsOutcome(std::move(result.GetError())); } - DescribeExportOutcome DynamoDBClient::DescribeExport(const DescribeExportRequest& request) const { - AWS_OPERATION_GUARD(DescribeExport); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DescribeExport, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DescribeExport, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DescribeExport, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DescribeExport", - {{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( - [&]() -> DescribeExportOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? DescribeExportOutcome(result.GetResultWithOwnership()) - : DescribeExportOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DescribeExportOutcome(result.GetResultWithOwnership()) : DescribeExportOutcome(std::move(result.GetError())); } - DescribeGlobalTableOutcome DynamoDBClient::DescribeGlobalTable(const DescribeGlobalTableRequest& request) const { - AWS_OPERATION_GUARD(DescribeGlobalTable); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DescribeGlobalTable, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DescribeGlobalTable, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DescribeGlobalTable, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DescribeGlobalTable", - {{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( - [&]() -> DescribeGlobalTableOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? DescribeGlobalTableOutcome(result.GetResultWithOwnership()) - : DescribeGlobalTableOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DescribeGlobalTableOutcome(result.GetResultWithOwnership()) + : DescribeGlobalTableOutcome(std::move(result.GetError())); } - DescribeGlobalTableSettingsOutcome DynamoDBClient::DescribeGlobalTableSettings(const DescribeGlobalTableSettingsRequest& request) const { - AWS_OPERATION_GUARD(DescribeGlobalTableSettings); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DescribeGlobalTableSettings, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DescribeGlobalTableSettings, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DescribeGlobalTableSettings, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DescribeGlobalTableSettings", - {{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( - [&]() -> DescribeGlobalTableSettingsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? DescribeGlobalTableSettingsOutcome(result.GetResultWithOwnership()) - : DescribeGlobalTableSettingsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DescribeGlobalTableSettingsOutcome(result.GetResultWithOwnership()) + : DescribeGlobalTableSettingsOutcome(std::move(result.GetError())); } - DescribeImportOutcome DynamoDBClient::DescribeImport(const DescribeImportRequest& request) const { - AWS_OPERATION_GUARD(DescribeImport); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DescribeImport, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DescribeImport, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DescribeImport, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DescribeImport", - {{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( - [&]() -> DescribeImportOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? DescribeImportOutcome(result.GetResultWithOwnership()) - : DescribeImportOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DescribeImportOutcome(result.GetResultWithOwnership()) : DescribeImportOutcome(std::move(result.GetError())); } - DescribeKinesisStreamingDestinationOutcome DynamoDBClient::DescribeKinesisStreamingDestination( const DescribeKinesisStreamingDestinationRequest& request) const { - AWS_OPERATION_GUARD(DescribeKinesisStreamingDestination); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DescribeKinesisStreamingDestination, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DescribeKinesisStreamingDestination, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DescribeKinesisStreamingDestination, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DescribeKinesisStreamingDestination", - {{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( - [&]() -> DescribeKinesisStreamingDestinationOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? DescribeKinesisStreamingDestinationOutcome(result.GetResultWithOwnership()) - : DescribeKinesisStreamingDestinationOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DescribeKinesisStreamingDestinationOutcome(result.GetResultWithOwnership()) + : DescribeKinesisStreamingDestinationOutcome(std::move(result.GetError())); } - DescribeLimitsOutcome DynamoDBClient::DescribeLimits(const DescribeLimitsRequest& request) const { - AWS_OPERATION_GUARD(DescribeLimits); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DescribeLimits, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DescribeLimits, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DescribeLimits, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DescribeLimits", - {{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( - [&]() -> DescribeLimitsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? DescribeLimitsOutcome(result.GetResultWithOwnership()) - : DescribeLimitsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DescribeLimitsOutcome(result.GetResultWithOwnership()) : DescribeLimitsOutcome(std::move(result.GetError())); } - DescribeTableOutcome DynamoDBClient::DescribeTable(const DescribeTableRequest& request) const { - AWS_OPERATION_GUARD(DescribeTable); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DescribeTable, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DescribeTable, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DescribeTable, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DescribeTable", - {{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( - [&]() -> DescribeTableOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? DescribeTableOutcome(result.GetResultWithOwnership()) - : DescribeTableOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DescribeTableOutcome(result.GetResultWithOwnership()) : DescribeTableOutcome(std::move(result.GetError())); } - DescribeTableReplicaAutoScalingOutcome DynamoDBClient::DescribeTableReplicaAutoScaling( const DescribeTableReplicaAutoScalingRequest& request) const { - AWS_OPERATION_GUARD(DescribeTableReplicaAutoScaling); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DescribeTableReplicaAutoScaling, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DescribeTableReplicaAutoScaling, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DescribeTableReplicaAutoScaling, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DescribeTableReplicaAutoScaling", - {{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( - [&]() -> DescribeTableReplicaAutoScalingOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? DescribeTableReplicaAutoScalingOutcome(result.GetResultWithOwnership()) - : DescribeTableReplicaAutoScalingOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DescribeTableReplicaAutoScalingOutcome(result.GetResultWithOwnership()) + : DescribeTableReplicaAutoScalingOutcome(std::move(result.GetError())); } - DescribeTimeToLiveOutcome DynamoDBClient::DescribeTimeToLive(const DescribeTimeToLiveRequest& request) const { - AWS_OPERATION_GUARD(DescribeTimeToLive); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DescribeTimeToLive, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DescribeTimeToLive, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DescribeTimeToLive, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DescribeTimeToLive", - {{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( - [&]() -> DescribeTimeToLiveOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? DescribeTimeToLiveOutcome(result.GetResultWithOwnership()) - : DescribeTimeToLiveOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DescribeTimeToLiveOutcome(result.GetResultWithOwnership()) + : DescribeTimeToLiveOutcome(std::move(result.GetError())); } - DisableKinesisStreamingDestinationOutcome DynamoDBClient::DisableKinesisStreamingDestination( const DisableKinesisStreamingDestinationRequest& request) const { - AWS_OPERATION_GUARD(DisableKinesisStreamingDestination); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DisableKinesisStreamingDestination, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DisableKinesisStreamingDestination, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DisableKinesisStreamingDestination, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".DisableKinesisStreamingDestination", - {{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( - [&]() -> DisableKinesisStreamingDestinationOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? DisableKinesisStreamingDestinationOutcome(result.GetResultWithOwnership()) - : DisableKinesisStreamingDestinationOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DisableKinesisStreamingDestinationOutcome(result.GetResultWithOwnership()) + : DisableKinesisStreamingDestinationOutcome(std::move(result.GetError())); } - EnableKinesisStreamingDestinationOutcome DynamoDBClient::EnableKinesisStreamingDestination( const EnableKinesisStreamingDestinationRequest& request) const { - AWS_OPERATION_GUARD(EnableKinesisStreamingDestination); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, EnableKinesisStreamingDestination, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, EnableKinesisStreamingDestination, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, EnableKinesisStreamingDestination, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".EnableKinesisStreamingDestination", - {{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( - [&]() -> EnableKinesisStreamingDestinationOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? EnableKinesisStreamingDestinationOutcome(result.GetResultWithOwnership()) - : EnableKinesisStreamingDestinationOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? EnableKinesisStreamingDestinationOutcome(result.GetResultWithOwnership()) + : EnableKinesisStreamingDestinationOutcome(std::move(result.GetError())); } - ExecuteStatementOutcome DynamoDBClient::ExecuteStatement(const ExecuteStatementRequest& request) const { - AWS_OPERATION_GUARD(ExecuteStatement); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ExecuteStatement, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ExecuteStatement, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ExecuteStatement, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ExecuteStatement", - {{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( - [&]() -> ExecuteStatementOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? ExecuteStatementOutcome(result.GetResultWithOwnership()) - : ExecuteStatementOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ExecuteStatementOutcome(result.GetResultWithOwnership()) + : ExecuteStatementOutcome(std::move(result.GetError())); } - ExecuteTransactionOutcome DynamoDBClient::ExecuteTransaction(const ExecuteTransactionRequest& request) const { - AWS_OPERATION_GUARD(ExecuteTransaction); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ExecuteTransaction, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ExecuteTransaction, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ExecuteTransaction, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ExecuteTransaction", - {{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( - [&]() -> ExecuteTransactionOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? ExecuteTransactionOutcome(result.GetResultWithOwnership()) - : ExecuteTransactionOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ExecuteTransactionOutcome(result.GetResultWithOwnership()) + : ExecuteTransactionOutcome(std::move(result.GetError())); } - ExportTableToPointInTimeOutcome DynamoDBClient::ExportTableToPointInTime(const ExportTableToPointInTimeRequest& request) const { - AWS_OPERATION_GUARD(ExportTableToPointInTime); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ExportTableToPointInTime, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ExportTableToPointInTime, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ExportTableToPointInTime, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ExportTableToPointInTime", - {{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( - [&]() -> ExportTableToPointInTimeOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? ExportTableToPointInTimeOutcome(result.GetResultWithOwnership()) - : ExportTableToPointInTimeOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ExportTableToPointInTimeOutcome(result.GetResultWithOwnership()) + : ExportTableToPointInTimeOutcome(std::move(result.GetError())); } - GetItemOutcome DynamoDBClient::GetItem(const GetItemRequest& request) const { - AWS_OPERATION_GUARD(GetItem); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetItem, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetItem, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetItem, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetItem", - {{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( - [&]() -> GetItemOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? GetItemOutcome(result.GetResultWithOwnership()) : GetItemOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GetItemOutcome(result.GetResultWithOwnership()) : GetItemOutcome(std::move(result.GetError())); } - GetResourcePolicyOutcome DynamoDBClient::GetResourcePolicy(const GetResourcePolicyRequest& request) const { - AWS_OPERATION_GUARD(GetResourcePolicy); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetResourcePolicy, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetResourcePolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetResourcePolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".GetResourcePolicy", - {{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( - [&]() -> GetResourcePolicyOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? GetResourcePolicyOutcome(result.GetResultWithOwnership()) - : GetResourcePolicyOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GetResourcePolicyOutcome(result.GetResultWithOwnership()) + : GetResourcePolicyOutcome(std::move(result.GetError())); } - ImportTableOutcome DynamoDBClient::ImportTable(const ImportTableRequest& request) const { - AWS_OPERATION_GUARD(ImportTable); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ImportTable, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ImportTable, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ImportTable, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ImportTable", - {{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( - [&]() -> ImportTableOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? ImportTableOutcome(result.GetResultWithOwnership()) : ImportTableOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ImportTableOutcome(result.GetResultWithOwnership()) : ImportTableOutcome(std::move(result.GetError())); } - ListBackupsOutcome DynamoDBClient::ListBackups(const ListBackupsRequest& request) const { - AWS_OPERATION_GUARD(ListBackups); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListBackups, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListBackups, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListBackups, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListBackups", - {{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( - [&]() -> ListBackupsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? ListBackupsOutcome(result.GetResultWithOwnership()) : ListBackupsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListBackupsOutcome(result.GetResultWithOwnership()) : ListBackupsOutcome(std::move(result.GetError())); } - ListContributorInsightsOutcome DynamoDBClient::ListContributorInsights(const ListContributorInsightsRequest& request) const { - AWS_OPERATION_GUARD(ListContributorInsights); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListContributorInsights, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListContributorInsights, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListContributorInsights, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListContributorInsights", - {{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( - [&]() -> ListContributorInsightsOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? ListContributorInsightsOutcome(result.GetResultWithOwnership()) - : ListContributorInsightsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListContributorInsightsOutcome(result.GetResultWithOwnership()) + : ListContributorInsightsOutcome(std::move(result.GetError())); } - ListExportsOutcome DynamoDBClient::ListExports(const ListExportsRequest& request) const { - AWS_OPERATION_GUARD(ListExports); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListExports, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListExports, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListExports, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListExports", - {{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( - [&]() -> ListExportsOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? ListExportsOutcome(result.GetResultWithOwnership()) : ListExportsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListExportsOutcome(result.GetResultWithOwnership()) : ListExportsOutcome(std::move(result.GetError())); } - ListGlobalTablesOutcome DynamoDBClient::ListGlobalTables(const ListGlobalTablesRequest& request) const { - AWS_OPERATION_GUARD(ListGlobalTables); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListGlobalTables, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListGlobalTables, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListGlobalTables, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListGlobalTables", - {{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( - [&]() -> ListGlobalTablesOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? ListGlobalTablesOutcome(result.GetResultWithOwnership()) - : ListGlobalTablesOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListGlobalTablesOutcome(result.GetResultWithOwnership()) + : ListGlobalTablesOutcome(std::move(result.GetError())); } - ListImportsOutcome DynamoDBClient::ListImports(const ListImportsRequest& request) const { - AWS_OPERATION_GUARD(ListImports); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListImports, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListImports, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListImports, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListImports", - {{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( - [&]() -> ListImportsOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? ListImportsOutcome(result.GetResultWithOwnership()) : ListImportsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListImportsOutcome(result.GetResultWithOwnership()) : ListImportsOutcome(std::move(result.GetError())); } - ListTablesOutcome DynamoDBClient::ListTables(const ListTablesRequest& request) const { - AWS_OPERATION_GUARD(ListTables); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListTables, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListTables, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListTables, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListTables", - {{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( - [&]() -> ListTablesOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? ListTablesOutcome(result.GetResultWithOwnership()) : ListTablesOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListTablesOutcome(result.GetResultWithOwnership()) : ListTablesOutcome(std::move(result.GetError())); } - ListTagsOfResourceOutcome DynamoDBClient::ListTagsOfResource(const ListTagsOfResourceRequest& request) const { - AWS_OPERATION_GUARD(ListTagsOfResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, ListTagsOfResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ListTagsOfResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, ListTagsOfResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".ListTagsOfResource", - {{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( - [&]() -> ListTagsOfResourceOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? ListTagsOfResourceOutcome(result.GetResultWithOwnership()) - : ListTagsOfResourceOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ListTagsOfResourceOutcome(result.GetResultWithOwnership()) + : ListTagsOfResourceOutcome(std::move(result.GetError())); } - PutItemOutcome DynamoDBClient::PutItem(const PutItemRequest& request) const { - AWS_OPERATION_GUARD(PutItem); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, PutItem, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, PutItem, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, PutItem, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".PutItem", - {{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( - [&]() -> PutItemOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? PutItemOutcome(result.GetResultWithOwnership()) : PutItemOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? PutItemOutcome(result.GetResultWithOwnership()) : PutItemOutcome(std::move(result.GetError())); } - PutResourcePolicyOutcome DynamoDBClient::PutResourcePolicy(const PutResourcePolicyRequest& request) const { - AWS_OPERATION_GUARD(PutResourcePolicy); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, PutResourcePolicy, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, PutResourcePolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, PutResourcePolicy, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".PutResourcePolicy", - {{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( - [&]() -> PutResourcePolicyOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? PutResourcePolicyOutcome(result.GetResultWithOwnership()) - : PutResourcePolicyOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? PutResourcePolicyOutcome(result.GetResultWithOwnership()) + : PutResourcePolicyOutcome(std::move(result.GetError())); } - QueryOutcome DynamoDBClient::Query(const QueryRequest& request) const { - AWS_OPERATION_GUARD(Query); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, Query, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, Query, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, Query, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".Query", - {{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( - [&]() -> QueryOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? QueryOutcome(result.GetResultWithOwnership()) : QueryOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? QueryOutcome(result.GetResultWithOwnership()) : QueryOutcome(std::move(result.GetError())); } - RestoreTableFromBackupOutcome DynamoDBClient::RestoreTableFromBackup(const RestoreTableFromBackupRequest& request) const { - AWS_OPERATION_GUARD(RestoreTableFromBackup); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, RestoreTableFromBackup, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, RestoreTableFromBackup, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, RestoreTableFromBackup, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".RestoreTableFromBackup", - {{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( - [&]() -> RestoreTableFromBackupOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? RestoreTableFromBackupOutcome(result.GetResultWithOwnership()) - : RestoreTableFromBackupOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? RestoreTableFromBackupOutcome(result.GetResultWithOwnership()) + : RestoreTableFromBackupOutcome(std::move(result.GetError())); } - RestoreTableToPointInTimeOutcome DynamoDBClient::RestoreTableToPointInTime(const RestoreTableToPointInTimeRequest& request) const { - AWS_OPERATION_GUARD(RestoreTableToPointInTime); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, RestoreTableToPointInTime, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, RestoreTableToPointInTime, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, RestoreTableToPointInTime, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".RestoreTableToPointInTime", - {{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( - [&]() -> RestoreTableToPointInTimeOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? RestoreTableToPointInTimeOutcome(result.GetResultWithOwnership()) - : RestoreTableToPointInTimeOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? RestoreTableToPointInTimeOutcome(result.GetResultWithOwnership()) + : RestoreTableToPointInTimeOutcome(std::move(result.GetError())); } - ScanOutcome DynamoDBClient::Scan(const ScanRequest& request) const { - AWS_OPERATION_GUARD(Scan); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, Scan, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, Scan, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, Scan, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".Scan", - {{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( - [&]() -> ScanOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? ScanOutcome(result.GetResultWithOwnership()) : ScanOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? ScanOutcome(result.GetResultWithOwnership()) : ScanOutcome(std::move(result.GetError())); } - TagResourceOutcome DynamoDBClient::TagResource(const TagResourceRequest& request) const { - AWS_OPERATION_GUARD(TagResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, TagResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, TagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, TagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".TagResource", - {{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( - [&]() -> TagResourceOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? TagResourceOutcome(result.GetResultWithOwnership()) : TagResourceOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? TagResourceOutcome(result.GetResultWithOwnership()) : TagResourceOutcome(std::move(result.GetError())); } - TransactGetItemsOutcome DynamoDBClient::TransactGetItems(const TransactGetItemsRequest& request) const { - AWS_OPERATION_GUARD(TransactGetItems); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, TransactGetItems, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, TransactGetItems, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, TransactGetItems, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".TransactGetItems", - {{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( - [&]() -> TransactGetItemsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? TransactGetItemsOutcome(result.GetResultWithOwnership()) - : TransactGetItemsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? TransactGetItemsOutcome(result.GetResultWithOwnership()) + : TransactGetItemsOutcome(std::move(result.GetError())); } - TransactWriteItemsOutcome DynamoDBClient::TransactWriteItems(const TransactWriteItemsRequest& request) const { - AWS_OPERATION_GUARD(TransactWriteItems); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, TransactWriteItems, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, TransactWriteItems, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, TransactWriteItems, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".TransactWriteItems", - {{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( - [&]() -> TransactWriteItemsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? TransactWriteItemsOutcome(result.GetResultWithOwnership()) - : TransactWriteItemsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? TransactWriteItemsOutcome(result.GetResultWithOwnership()) + : TransactWriteItemsOutcome(std::move(result.GetError())); } - UntagResourceOutcome DynamoDBClient::UntagResource(const UntagResourceRequest& request) const { - AWS_OPERATION_GUARD(UntagResource); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UntagResource, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UntagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UntagResource, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UntagResource", - {{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( - [&]() -> UntagResourceOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? UntagResourceOutcome(result.GetResultWithOwnership()) - : UntagResourceOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? UntagResourceOutcome(result.GetResultWithOwnership()) : UntagResourceOutcome(std::move(result.GetError())); } - UpdateContinuousBackupsOutcome DynamoDBClient::UpdateContinuousBackups(const UpdateContinuousBackupsRequest& request) const { - AWS_OPERATION_GUARD(UpdateContinuousBackups); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateContinuousBackups, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateContinuousBackups, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateContinuousBackups, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateContinuousBackups", - {{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( - [&]() -> UpdateContinuousBackupsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? UpdateContinuousBackupsOutcome(result.GetResultWithOwnership()) - : UpdateContinuousBackupsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? UpdateContinuousBackupsOutcome(result.GetResultWithOwnership()) + : UpdateContinuousBackupsOutcome(std::move(result.GetError())); } - UpdateContributorInsightsOutcome DynamoDBClient::UpdateContributorInsights(const UpdateContributorInsightsRequest& request) const { - AWS_OPERATION_GUARD(UpdateContributorInsights); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateContributorInsights, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateContributorInsights, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateContributorInsights, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateContributorInsights", - {{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( - [&]() -> UpdateContributorInsightsOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? UpdateContributorInsightsOutcome(result.GetResultWithOwnership()) - : UpdateContributorInsightsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? UpdateContributorInsightsOutcome(result.GetResultWithOwnership()) + : UpdateContributorInsightsOutcome(std::move(result.GetError())); } - UpdateGlobalTableOutcome DynamoDBClient::UpdateGlobalTable(const UpdateGlobalTableRequest& request) const { - AWS_OPERATION_GUARD(UpdateGlobalTable); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateGlobalTable, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateGlobalTable, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateGlobalTable, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateGlobalTable", - {{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( - [&]() -> UpdateGlobalTableOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? UpdateGlobalTableOutcome(result.GetResultWithOwnership()) - : UpdateGlobalTableOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? UpdateGlobalTableOutcome(result.GetResultWithOwnership()) + : UpdateGlobalTableOutcome(std::move(result.GetError())); } - UpdateGlobalTableSettingsOutcome DynamoDBClient::UpdateGlobalTableSettings(const UpdateGlobalTableSettingsRequest& request) const { - AWS_OPERATION_GUARD(UpdateGlobalTableSettings); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateGlobalTableSettings, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateGlobalTableSettings, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateGlobalTableSettings, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateGlobalTableSettings", - {{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( - [&]() -> UpdateGlobalTableSettingsOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? UpdateGlobalTableSettingsOutcome(result.GetResultWithOwnership()) - : UpdateGlobalTableSettingsOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? UpdateGlobalTableSettingsOutcome(result.GetResultWithOwnership()) + : UpdateGlobalTableSettingsOutcome(std::move(result.GetError())); } - UpdateItemOutcome DynamoDBClient::UpdateItem(const UpdateItemRequest& request) const { - AWS_OPERATION_GUARD(UpdateItem); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateItem, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateItem, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateItem, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateItem", - {{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( - [&]() -> UpdateItemOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? UpdateItemOutcome(result.GetResultWithOwnership()) : UpdateItemOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? UpdateItemOutcome(result.GetResultWithOwnership()) : UpdateItemOutcome(std::move(result.GetError())); } - UpdateKinesisStreamingDestinationOutcome DynamoDBClient::UpdateKinesisStreamingDestination( const UpdateKinesisStreamingDestinationRequest& request) const { - AWS_OPERATION_GUARD(UpdateKinesisStreamingDestination); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateKinesisStreamingDestination, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateKinesisStreamingDestination, CoreErrors, - CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateKinesisStreamingDestination, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateKinesisStreamingDestination", - {{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( - [&]() -> UpdateKinesisStreamingDestinationOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? UpdateKinesisStreamingDestinationOutcome(result.GetResultWithOwnership()) - : UpdateKinesisStreamingDestinationOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? UpdateKinesisStreamingDestinationOutcome(result.GetResultWithOwnership()) + : UpdateKinesisStreamingDestinationOutcome(std::move(result.GetError())); } - UpdateTableOutcome DynamoDBClient::UpdateTable(const UpdateTableRequest& request) const { - AWS_OPERATION_GUARD(UpdateTable); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateTable, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateTable, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateTable, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateTable", - {{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( - [&]() -> UpdateTableOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? UpdateTableOutcome(result.GetResultWithOwnership()) : UpdateTableOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? UpdateTableOutcome(result.GetResultWithOwnership()) : UpdateTableOutcome(std::move(result.GetError())); } - UpdateTableReplicaAutoScalingOutcome DynamoDBClient::UpdateTableReplicaAutoScaling( const UpdateTableReplicaAutoScalingRequest& request) const { - AWS_OPERATION_GUARD(UpdateTableReplicaAutoScaling); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateTableReplicaAutoScaling, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateTableReplicaAutoScaling, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateTableReplicaAutoScaling, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateTableReplicaAutoScaling", - {{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( - [&]() -> UpdateTableReplicaAutoScalingOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? UpdateTableReplicaAutoScalingOutcome(result.GetResultWithOwnership()) - : UpdateTableReplicaAutoScalingOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? UpdateTableReplicaAutoScalingOutcome(result.GetResultWithOwnership()) + : UpdateTableReplicaAutoScalingOutcome(std::move(result.GetError())); } - UpdateTimeToLiveOutcome DynamoDBClient::UpdateTimeToLive(const UpdateTimeToLiveRequest& request) const { - AWS_OPERATION_GUARD(UpdateTimeToLive); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, UpdateTimeToLive, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, UpdateTimeToLive, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, UpdateTimeToLive, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + ".UpdateTimeToLive", - {{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( - [&]() -> UpdateTimeToLiveOutcome { - auto result = MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { - Aws::String endpointKey{"Shared"}; - DescribeEndpointsRequest endpointRequest{}; - this->OptionallyUpdateDescribeEndpointsCache( - resolvedEndpoint, request.GetServiceRequestName(), endpointKey, endpointRequest, false); - }); - return result.IsSuccess() ? UpdateTimeToLiveOutcome(result.GetResultWithOwnership()) - : UpdateTimeToLiveOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? UpdateTimeToLiveOutcome(result.GetResultWithOwnership()) + : UpdateTimeToLiveOutcome(std::move(result.GetError())); } void DynamoDBClient::OptionallyUpdateDescribeEndpointsCache(Aws::Endpoint::AWSEndpoint& resolvedEndpoint, const Aws::String& operationName, diff --git a/generated/src/aws-cpp-sdk-sts/include/aws/sts/STSClient.h b/generated/src/aws-cpp-sdk-sts/include/aws/sts/STSClient.h index ff8c3d0927c9..96f971b6c9ab 100644 --- a/generated/src/aws-cpp-sdk-sts/include/aws/sts/STSClient.h +++ b/generated/src/aws-cpp-sdk-sts/include/aws/sts/STSClient.h @@ -928,6 +928,10 @@ class AWS_STS_API STSClient private: friend class Aws::Client::ClientWithAsyncTemplateMethods; + + typedef Aws::Utils::Outcome, STSError> InvokeOperationOutcome; + + InvokeOperationOutcome InvokeServiceOperation(const AmazonWebServiceRequest& request, Aws::Http::HttpMethod httpMethod) const; }; } // namespace STS diff --git a/generated/src/aws-cpp-sdk-sts/source/STSClient.cpp b/generated/src/aws-cpp-sdk-sts/source/STSClient.cpp index 041857c038f4..1290e77f300f 100644 --- a/generated/src/aws-cpp-sdk-sts/source/STSClient.cpp +++ b/generated/src/aws-cpp-sdk-sts/source/STSClient.cpp @@ -191,275 +191,96 @@ Aws::String STSClient::ConvertRequestToPresignedUrl(const AmazonSerializableWebS return AwsSmithyClientT::GeneratePresignedUrl(std::move(endpointCallback), Aws::Http::HttpMethod::HTTP_GET, region, GetServiceName(), 3600, {}, {}); } -AssumeRoleOutcome STSClient::AssumeRole(const AssumeRoleRequest& request) const { - AWS_OPERATION_GUARD(AssumeRole); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, AssumeRole, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, AssumeRole, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, AssumeRole, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + "." + request.GetServiceRequestName(), - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}, +STSClient::InvokeOperationOutcome STSClient::InvokeServiceOperation(const AmazonWebServiceRequest& request, + Aws::Http::HttpMethod httpMethod) const { + auto operationName = request.GetServiceRequestName(); + auto serviceName = GetServiceClientName(); + + AWS_OPERATION_GUARD_DYNAMIC(operationName); + + AWS_OPERATION_CHECK_PTR_DYNAMIC(m_clientConfiguration.telemetryProvider, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto tracer = m_clientConfiguration.telemetryProvider->getTracer(serviceName, {}); + auto meter = m_clientConfiguration.telemetryProvider->getMeter(serviceName, {}); + AWS_OPERATION_CHECK_PTR_DYNAMIC(meter, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto span = tracer->CreateSpan(Aws::String(serviceName) + "." + operationName, + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, + {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}, {TracingUtils::SMITHY_SYSTEM_DIMENSION, TracingUtils::SMITHY_METHOD_AWS_VALUE}}, smithy::components::tracing::SpanKind::CLIENT); - return TracingUtils::MakeCallWithTiming( - [&]() -> AssumeRoleOutcome { + + return TracingUtils::MakeCallWithTiming( + [&]() -> InvokeOperationOutcome { auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, + MakeRequestDeserialize(&request, operationName, httpMethod, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? AssumeRoleOutcome(result.GetResultWithOwnership()) : AssumeRoleOutcome(std::move(result.GetError())); + return result.IsSuccess() ? InvokeOperationOutcome(result.GetResultWithOwnership()) + : InvokeOperationOutcome(std::move(result.GetError())); }, TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}}); +} +AssumeRoleOutcome STSClient::AssumeRole(const AssumeRoleRequest& request) const { + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? AssumeRoleOutcome(result.GetResultWithOwnership()) : AssumeRoleOutcome(std::move(result.GetError())); } AssumeRoleWithSAMLOutcome STSClient::AssumeRoleWithSAML(const AssumeRoleWithSAMLRequest& request) const { - AWS_OPERATION_GUARD(AssumeRoleWithSAML); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, AssumeRoleWithSAML, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, AssumeRoleWithSAML, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, AssumeRoleWithSAML, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + "." + request.GetServiceRequestName(), - {{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( - [&]() -> AssumeRoleWithSAMLOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? AssumeRoleWithSAMLOutcome(result.GetResultWithOwnership()) - : AssumeRoleWithSAMLOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? AssumeRoleWithSAMLOutcome(result.GetResultWithOwnership()) + : AssumeRoleWithSAMLOutcome(std::move(result.GetError())); } AssumeRoleWithWebIdentityOutcome STSClient::AssumeRoleWithWebIdentity(const AssumeRoleWithWebIdentityRequest& request) const { - AWS_OPERATION_GUARD(AssumeRoleWithWebIdentity); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, AssumeRoleWithWebIdentity, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, AssumeRoleWithWebIdentity, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, AssumeRoleWithWebIdentity, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + "." + request.GetServiceRequestName(), - {{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( - [&]() -> AssumeRoleWithWebIdentityOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? AssumeRoleWithWebIdentityOutcome(result.GetResultWithOwnership()) - : AssumeRoleWithWebIdentityOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? AssumeRoleWithWebIdentityOutcome(result.GetResultWithOwnership()) + : AssumeRoleWithWebIdentityOutcome(std::move(result.GetError())); } AssumeRootOutcome STSClient::AssumeRoot(const AssumeRootRequest& request) const { - AWS_OPERATION_GUARD(AssumeRoot); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, AssumeRoot, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, AssumeRoot, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, AssumeRoot, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + "." + request.GetServiceRequestName(), - {{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( - [&]() -> AssumeRootOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? AssumeRootOutcome(result.GetResultWithOwnership()) : AssumeRootOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? AssumeRootOutcome(result.GetResultWithOwnership()) : AssumeRootOutcome(std::move(result.GetError())); } DecodeAuthorizationMessageOutcome STSClient::DecodeAuthorizationMessage(const DecodeAuthorizationMessageRequest& request) const { - AWS_OPERATION_GUARD(DecodeAuthorizationMessage); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, DecodeAuthorizationMessage, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, DecodeAuthorizationMessage, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, DecodeAuthorizationMessage, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + "." + request.GetServiceRequestName(), - {{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( - [&]() -> DecodeAuthorizationMessageOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? DecodeAuthorizationMessageOutcome(result.GetResultWithOwnership()) - : DecodeAuthorizationMessageOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? DecodeAuthorizationMessageOutcome(result.GetResultWithOwnership()) + : DecodeAuthorizationMessageOutcome(std::move(result.GetError())); } GetAccessKeyInfoOutcome STSClient::GetAccessKeyInfo(const GetAccessKeyInfoRequest& request) const { - AWS_OPERATION_GUARD(GetAccessKeyInfo); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetAccessKeyInfo, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetAccessKeyInfo, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetAccessKeyInfo, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + "." + request.GetServiceRequestName(), - {{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( - [&]() -> GetAccessKeyInfoOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? GetAccessKeyInfoOutcome(result.GetResultWithOwnership()) - : GetAccessKeyInfoOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GetAccessKeyInfoOutcome(result.GetResultWithOwnership()) + : GetAccessKeyInfoOutcome(std::move(result.GetError())); } GetCallerIdentityOutcome STSClient::GetCallerIdentity(const GetCallerIdentityRequest& request) const { - AWS_OPERATION_GUARD(GetCallerIdentity); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetCallerIdentity, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetCallerIdentity, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetCallerIdentity, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + "." + request.GetServiceRequestName(), - {{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( - [&]() -> GetCallerIdentityOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? GetCallerIdentityOutcome(result.GetResultWithOwnership()) - : GetCallerIdentityOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GetCallerIdentityOutcome(result.GetResultWithOwnership()) + : GetCallerIdentityOutcome(std::move(result.GetError())); } GetDelegatedAccessTokenOutcome STSClient::GetDelegatedAccessToken(const GetDelegatedAccessTokenRequest& request) const { - AWS_OPERATION_GUARD(GetDelegatedAccessToken); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetDelegatedAccessToken, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetDelegatedAccessToken, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetDelegatedAccessToken, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + "." + request.GetServiceRequestName(), - {{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( - [&]() -> GetDelegatedAccessTokenOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? GetDelegatedAccessTokenOutcome(result.GetResultWithOwnership()) - : GetDelegatedAccessTokenOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GetDelegatedAccessTokenOutcome(result.GetResultWithOwnership()) + : GetDelegatedAccessTokenOutcome(std::move(result.GetError())); } GetFederationTokenOutcome STSClient::GetFederationToken(const GetFederationTokenRequest& request) const { - AWS_OPERATION_GUARD(GetFederationToken); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetFederationToken, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetFederationToken, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetFederationToken, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + "." + request.GetServiceRequestName(), - {{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( - [&]() -> GetFederationTokenOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? GetFederationTokenOutcome(result.GetResultWithOwnership()) - : GetFederationTokenOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GetFederationTokenOutcome(result.GetResultWithOwnership()) + : GetFederationTokenOutcome(std::move(result.GetError())); } GetSessionTokenOutcome STSClient::GetSessionToken(const GetSessionTokenRequest& request) const { - AWS_OPERATION_GUARD(GetSessionToken); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetSessionToken, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetSessionToken, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetSessionToken, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + "." + request.GetServiceRequestName(), - {{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( - [&]() -> GetSessionTokenOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? GetSessionTokenOutcome(result.GetResultWithOwnership()) - : GetSessionTokenOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GetSessionTokenOutcome(result.GetResultWithOwnership()) + : GetSessionTokenOutcome(std::move(result.GetError())); } GetWebIdentityTokenOutcome STSClient::GetWebIdentityToken(const GetWebIdentityTokenRequest& request) const { - AWS_OPERATION_GUARD(GetWebIdentityToken); - AWS_OPERATION_CHECK_PTR(m_endpointProvider, GetWebIdentityToken, CoreErrors, CoreErrors::ENDPOINT_RESOLUTION_FAILURE); - AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, GetWebIdentityToken, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto tracer = m_clientConfiguration.telemetryProvider->getTracer(this->GetServiceClientName(), {}); - auto meter = m_clientConfiguration.telemetryProvider->getMeter(this->GetServiceClientName(), {}); - AWS_OPERATION_CHECK_PTR(meter, GetWebIdentityToken, CoreErrors, CoreErrors::NOT_INITIALIZED); - auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + "." + request.GetServiceRequestName(), - {{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( - [&]() -> GetWebIdentityTokenOutcome { - auto result = - MakeRequestDeserialize(&request, request.GetServiceRequestName(), Aws::Http::HttpMethod::HTTP_POST, - [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { AWS_UNREFERENCED_PARAM(resolvedEndpoint); }); - return result.IsSuccess() ? GetWebIdentityTokenOutcome(result.GetResultWithOwnership()) - : GetWebIdentityTokenOutcome(std::move(result.GetError())); - }, - TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, - {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, - {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_POST); + return result.IsSuccess() ? GetWebIdentityTokenOutcome(result.GetResultWithOwnership()) + : GetWebIdentityTokenOutcome(std::move(result.GetError())); } diff --git a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyClientHeader.vm b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyClientHeader.vm index 4ff3b61fdced..bff4908a4597 100644 --- a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyClientHeader.vm +++ b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyClientHeader.vm @@ -111,6 +111,8 @@ namespace ${serviceNamespace} private: friend class ${rootNamespace}::Client::ClientWithAsyncTemplateMethods<${className}>; +#parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceInvokeOperationHeader.vm") + #if($metadata.hasEndpointDiscoveryTrait) void OptionallyUpdateDescribeEndpointsCache(${rootNamespace}::Endpoint::AWSEndpoint& resolvedEndpoint, const ${rootNamespace}::String& operationName, diff --git a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyClientSource.vm b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyClientSource.vm index c1de1ec87885..298dd4860c6e 100644 --- a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyClientSource.vm +++ b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyClientSource.vm @@ -47,8 +47,8 @@ const char* ${className}::GetServiceName() {return SERVICE_NAME;} const char* ${className}::GetAllocationTag() {return ALLOCATION_TAG;} #parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyClientSourceInit.vm") +#parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceInvokeOperationSource.vm") #end - #parse("/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyJsonServiceOperationsSource.vm") #if($metadata.hasEndpointDiscoveryTrait) diff --git a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyRestXmlServiceClientOperations.vm b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyRestXmlServiceClientOperations.vm index 4e51a44f8ffd..9541454ff53b 100644 --- a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyRestXmlServiceClientOperations.vm +++ b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyRestXmlServiceClientOperations.vm @@ -29,10 +29,8 @@ #if($operation.request) ${operation.name}Outcome ${className}::${operation.name}(${constText}${operation.request.shape.name}& request) const { -#if(!$operation.result.shape.hasEventStreamMembers() && !$operation.result.shape.hasStreamMembers() && false) - ## This is not included in SmithyClientHeader, and this should be done for BOTH smithyJson and smithyRestXml (not just xml) - ## hence the false - #parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/common/ServiceInvokeOperationMethod.vm") +#if(!$operation.result.shape.hasEventStreamMembers() && !$operation.result.shape.hasStreamMembers()) + #parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceInvokeOperationMethod.vm") #else AWS_OPERATION_GUARD(${operation.name}); #parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/common/ServiceClientOperationRequestRequiredMemberValidate.vm") diff --git a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyRestXmlServiceClientSource.vm b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyRestXmlServiceClientSource.vm index 3b60dc932142..8f88be49799a 100644 --- a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyRestXmlServiceClientSource.vm +++ b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyRestXmlServiceClientSource.vm @@ -89,6 +89,7 @@ Aws::String ${className}::GenerateConnectAuthToken(const char* dbHostName, const #end #end +#parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceInvokeOperationSource.vm") #end #if($serviceNamespace == "S3Crt") #parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/s3/s3-crt/SmithyS3CrtSpecificOperations.vm") diff --git a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceInvokeOperationHeader.vm b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceInvokeOperationHeader.vm new file mode 100644 index 000000000000..fadb5fcf4d8d --- /dev/null +++ b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceInvokeOperationHeader.vm @@ -0,0 +1,15 @@ +## Be careful to not have this outcome name clash with an operation outcome name (specifically lambda:Invoke) +#if($serviceModel.metadata.findFirstSupportedProtocol() == "json" || $serviceModel.metadata.findFirstSupportedProtocol() == "rest-json" || $serviceModel.metadata.findFirstSupportedProtocol() == "application-json") +#set($invokeResponseType = "Aws::Utils::Json::JsonValue") +#elseif($serviceModel.metadata.findFirstSupportedProtocol() == "rest-xml" || $serviceModel.metadata.findFirstSupportedProtocol() == "query") +#set($invokeResponseType = "Aws::Utils::Xml::XmlDocument") +#end +typedef Aws::Utils::Outcome, ${metadata.classNamePrefix}Error> InvokeOperationOutcome; + +InvokeOperationOutcome InvokeServiceOperation( + const AmazonWebServiceRequest& request, +#if($metadata.protocol == "rest-json" || $metadata.protocol == "rest-xml") + const std::function& resolveUri, +#end + Aws::Http::HttpMethod httpMethod +) const; diff --git a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceInvokeOperationMethod.vm b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceInvokeOperationMethod.vm new file mode 100644 index 000000000000..881e801cd0a8 --- /dev/null +++ b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceInvokeOperationMethod.vm @@ -0,0 +1,13 @@ +#set($emitGenericOperation = true) +#parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/common/ServiceClientOperationRequestRequiredMemberValidate.vm") +#set($emitGenericOperation = false) + +#if($metadata.protocol == "rest-json" || $metadata.protocol == "rest-xml") + auto result = InvokeServiceOperation(request, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) { +#parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyUriRequestQueryParams.vm") + }, Aws::Http::HttpMethod::HTTP_${operation.http.method}); + return result.IsSuccess() ? ${operation.name}Outcome(result.GetResultWithOwnership()) : ${operation.name}Outcome(std::move(result.GetError())); +#else + auto result = InvokeServiceOperation(request, Aws::Http::HttpMethod::HTTP_${operation.http.method}); + return result.IsSuccess() ? ${operation.name}Outcome(result.GetResultWithOwnership()) : ${operation.name}Outcome(std::move(result.GetError())); +#end diff --git a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceInvokeOperationSource.vm b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceInvokeOperationSource.vm new file mode 100644 index 000000000000..88393d0ed898 --- /dev/null +++ b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceInvokeOperationSource.vm @@ -0,0 +1,40 @@ +${className}::InvokeOperationOutcome ${className}::InvokeServiceOperation( + const AmazonWebServiceRequest& request, +#if($metadata.protocol == "rest-json" || $metadata.protocol == "rest-xml") + const std::function& resolveUri, +#end + Aws::Http::HttpMethod httpMethod +) const +{ + auto operationName = request.GetServiceRequestName(); + auto serviceName = GetServiceClientName(); + + AWS_OPERATION_GUARD_DYNAMIC(operationName); + + AWS_OPERATION_CHECK_PTR_DYNAMIC(m_clientConfiguration.telemetryProvider, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto tracer = m_clientConfiguration.telemetryProvider->getTracer(serviceName, {}); + auto meter = m_clientConfiguration.telemetryProvider->getMeter(serviceName, {}); + AWS_OPERATION_CHECK_PTR_DYNAMIC(meter, operationName, CoreErrors, CoreErrors::NOT_INITIALIZED); + + auto span = tracer->CreateSpan(Aws::String(serviceName) + "." + operationName, + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, + {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}, + {TracingUtils::SMITHY_SYSTEM_DIMENSION, TracingUtils::SMITHY_METHOD_AWS_VALUE}}, + smithy::components::tracing::SpanKind::CLIENT); + + return TracingUtils::MakeCallWithTiming( + [&]() -> InvokeOperationOutcome { + auto result = MakeRequestDeserialize(&request, operationName, httpMethod, [&](Aws::Endpoint::AWSEndpoint& resolvedEndpoint) -> void { +#if($metadata.protocol == "rest-json" || $metadata.protocol == "rest-xml") + resolveUri(resolvedEndpoint); +#else + AWS_UNREFERENCED_PARAM(resolvedEndpoint); +#end + }); + return result.IsSuccess() ? InvokeOperationOutcome(result.GetResultWithOwnership()) : InvokeOperationOutcome(std::move(result.GetError())); + }, + TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, + {{TracingUtils::SMITHY_METHOD_DIMENSION, operationName}, + {TracingUtils::SMITHY_SERVICE_DIMENSION, serviceName}}); +} diff --git a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceOperationsSource.vm b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceOperationsSource.vm index e0da977c6c0d..e0da8d400935 100644 --- a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceOperationsSource.vm +++ b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceOperationsSource.vm @@ -1,5 +1,8 @@ ${operation.name}Outcome ${className}::${operation.name}(${constText}${operation.request.shape.name}& request) const { +#if(!$operation.result.shape.hasEventStreamMembers() && !$operation.result.shape.hasStreamMembers()) + #parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/smithy/SmithyServiceInvokeOperationMethod.vm") +#else AWS_OPERATION_GUARD(${operation.name}); #parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/common/ServiceClientOperationRequestRequiredMemberValidate.vm") AWS_OPERATION_CHECK_PTR(m_clientConfiguration.telemetryProvider, ${operation.name}, CoreErrors, CoreErrors::NOT_INITIALIZED); @@ -36,5 +39,5 @@ ${operation.name}Outcome ${className}::${operation.name}(${constText}${operation TracingUtils::SMITHY_CLIENT_DURATION_METRIC, *meter, {{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); +#end } -