Creates a new segment for an application or updates the configuration, dimension, and other settings for an existing segment that's associated with an application.
Parameters:
-
application_id
(__string)
–
The unique identifier for the application. This identifier is displayed as the Project ID on the Amazon Pinpoint console.
-
segment_id
(__string)
–
The unique identifier for the segment.
Raises:
Source code in docs_src/capo_pinpoint/_services/async_pinpoint.py
| async def update_segment(
self,
application_id: "capo_pinpoint.types.__string.__string",
segment_id: "capo_pinpoint.types.__string.__string",
*,
config_overrides: Optional[AsyncPinpointClientConfig] = None,
write_segment_request: Optional[
"capo_pinpoint.types.write_segment_request.WriteSegmentRequest"
] = None,
) -> "capo_pinpoint.types.update_segment_response.UpdateSegmentResponse":
"""<p>Creates a new segment for an application or updates the configuration, dimension, and other settings for an existing segment that's associated with an application.</p>
Args:
application_id: <p>The unique identifier for the application. This identifier is displayed as the <b>Project ID</b> on the Amazon Pinpoint console.</p>
segment_id: <p>The unique identifier for the segment.</p>
Raises:
capo_pinpoint.errors.bad_request_exception.BadRequestException: <p>Provides information about an API request or response.</p>
capo_pinpoint.errors.forbidden_exception.ForbiddenException: <p>Provides information about an API request or response.</p>
capo_pinpoint.errors.internal_server_error_exception.InternalServerErrorException: <p>Provides information about an API request or response.</p>
capo_pinpoint.errors.method_not_allowed_exception.MethodNotAllowedException: <p>Provides information about an API request or response.</p>
capo_pinpoint.errors.not_found_exception.NotFoundException: <p>Provides information about an API request or response.</p>
capo_pinpoint.errors.payload_too_large_exception.PayloadTooLargeException: <p>Provides information about an API request or response.</p>
capo_pinpoint.errors.too_many_requests_exception.TooManyRequestsException: <p>Provides information about an API request or response.</p>
capo_pinpoint.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_pinpoint.types.update_segment_request.UpdateSegmentRequest]",
) -> AsyncOperationResponse[
"capo_pinpoint.types.update_segment_response.UpdateSegmentResponse"
]:
import capo_pinpoint._operations.pinpoint.update_segment
(
output,
http_response,
) = await capo_pinpoint._operations.pinpoint.update_segment.async_update_segment(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateSegment")
)
input_: capo_pinpoint.types.update_segment_request.UpdateSegmentRequest = {
"application_id": application_id,
"segment_id": segment_id,
}
if write_segment_request is not None:
input_["write_segment_request"] = write_segment_request
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|